How to override mod layout?


I need customize layout of some mods.

eg.: members, search, groups...

How to do this in my theme?

I try override search box template, but not success:


I modify this file but not work, help.

  • Path should be /mod/MYTHEMEDIR/views/default/search/search_box.php.

  • You should check out Developer guides in the docs. Here's about overriding views.

  • iionly, i try, but don't work.

    Per Jensen, i read this documentation, but this not help me, i did not understand well.

    Please, any idea?

  • If you have simply cache / system cache enabled in the advanced settings of your site, any changes you make won't become visible immediately. Only if you flush the cache (by clicking the corresponding button on the admin dashboard) the cache will be freshly built up. Does the modification show up after flushing the cache? During developing it might be best to keep the caching disabled. Then the changes will show up immediately.

    If the change you made in /mod/MYTHEMEDIR/views/default/search/search_box.php still does not show up you should check if any other plugin (that's below your MYTHEMEDIR plugin in the plugin list) also overrides the same view. If this is the case the changed view of your plugin get overridden by it again. In this case place your plugin below this other plugin. If the reason a change does not show up is not due to another plugin: are you sure that you modify the correct view?

  • I place my theme/plugin for end of list, search custom view works, I did not know the positioning of the plugins influenced. Is there any way to avoid this?

  • How to position search box in the menu?

    Currently my layout is like this:

    Is possible?

  • By default search is added to the header by extending a view. You can add it to another view the same way,

    elgg_unextend_view('page/elements/header', 'search/header');
    elgg_extend_view('page/elements/mymenu', 'search/header');

  • How to know the view of the menu?

    I tried:

    elgg_unextend_view('page/elements/header', 'search/header');
    elgg_extend_view('navigation/menu/site', 'search/header');

    In start.php into the my theme init function, but not work, i'm doing right?

  • I think i learned ^^

    In: mod/MYCOOLTHEME/views/default/navigation/menu

    I created a file called: search.php

    Finally created a view in: mod/MYCOOLTHEME/views/default/navigation/menu/site.php


    echo elgg_view('navigation/menu/search');

    Now it worked, thanks!