Remove Menu and Topbar elgg 1.8

Hi!

How do I remove the top bar and the elgg menu in elgg 1.8?

Do I use elgg_unregister or elgg_unextend and how?

Thanks!

  • elgg_unregister_menu_item('topbar', 'elgg_logo');

     

  • The easiest way is to override the page/elements/topbar view with an empty view.

  • he's right ;-) no code needed !;-oO;X

    mi buen amigo como esto aquí LOLZ ;-P => 

    ELGG := Elgg1830_BASE/views/default/page/elements/topbar.php
    PLUGIN := Elgg1830_BASE/mod/PLUGIN/views/default/page/elements/topbar.php
    --> empty view ;-o

     

  • @Brett @Dhrup Oh Thanks!!

    Now, what about the other menu? I also want to remove it. Do I do an empty view too?

  • this empty view 'removes' the top bar ;-)

    what 'other menu' ?

     

  • The one below the top bar, where the 'Activity' Link is

  • That's the site menu. Every menu in 1.8 is printed with elgg_view_menu($menu_name). To find where menus are printed, look for elgg_view_menu calls. For this one, look for elgg_view_menu('site').

    A few ways to do this:

    • Override the view that calls elgg_view_menu() and remove the call. In this case it's page/elements/header.
    • Override the menu's specific view with an empty view. Each menu looks for a view navigation/menu/$menu_name. In this case it's navigation/menu/site.
    • Hook into the prepare, menu:<menu_name> hook and remove all the items (i.e., return an empty array). Would look like elgg_register_plugin_hook_handler('prepare', 'menu:site', 'your_callback_function');

     

  • Great topic.

    My question is is there a way to unregister only right side of the topbar menu (with admin and setting links) ?

    On same note is there a way to display only right or left menu somewhere else? (one is elgg-menu-default and other elgg-menu-alt) ?

    One more thing, I've been reading http://docs.elgg.org/wiki/Menus on menus but when creating/registering new menu how and where to specify the class (default or alt, left ot right)?

    For testing I have this code to register new menus:

    elgg_register_menu_item('foo', new ElggMenuItem('itemname', 'Item Text', '/'));  and

    elgg_register_menu_item('footwo', array(
        'name' => 'itemname',
        'text' => 'This is an item\'s text',
        'href' => '/',
    ));

    and to display:

    echo elgg_view_menu('foo', array('sort_by' => 'priority', array('elgg-menu-hz')));

    echo elgg_view_menu('footwo', array('sort_by' => 'priority', array('elgg-menu-hz')));

    That works but both menus are assigned "default" class. How to specify the "alt" class?

    Thanks for your help.

  • elgg_register_menu_item('footwo', array(
        'name' => 'itemname',
        'text' => 'This is an item\'s text',
        'href' => '/',

    'section' => 'alt',

    ));

    use the section option