how to add new links to menu of facebook theme

I used menu builder in default theme but it didnot work with facebook theme

  • There are so many "Facebook" theme plugins here on the site - and I don't think any of them is still maintained (and therefore I would suggest to not use any of them anyway) - that it's quite impossible to give any advice how to add new menu links specifically in one of these plugins.

    Does the Facebook theme even shows a "site menu"? The menu builder plugin can only alter the site theme and not any other menus.

    The (original) Elgg-Facebook Theme plugin registers the menu items in its start.php. So, it might be the same with the theme plugin you are using. Then you can add new menu items in the same way as already done for the existing menu items by adding the corresponding code in start.php.

  • iionly thanx so much...if i want to add url(ex:youtube.com) to menu .what is the corresponding code to add in start.php? and after which queue in start.php?

  • Without knowing which "Facebook" plugin you use I can't say where to add the code exactly. There are two ways to add menu items used in start.php of the original Facebook theme plugin. Just look for code similar to the following (if you look at your site with the Facebook plugin used you should find the corresponding menu items like blogs, bookmarks etc. and this should help you to understand which menu item is registered where in the code and where to add your own code for your own menu item).

    A static menu item can be registered as follows (the "contexts" attribute is also set for the other existing menu items in the plugin this way):

    elgg_register_menu_item('page', array(
        'name' => "youtube",
        'text' => "Youtube",
        'href' => "https://youtube.com",
        'contexts' => array('dashboard'),
    ));

    Dynamically created menu items are added in plugin hook callback functions (where the array of menu items - in this case $items - is returned at the end of the function. "priority" allows to define the order of the menu items in the menu):

    $items[] = ElggMenuItem::factory(array(
        'name' => "youtube",
        'href' => "https://youtube.com",
        'text' => "Youtube",
        'priority' => 999,
    ));

     

  • I use facebook version 1.8...i tried to add this lines to start.php but it always resulted into white page instead of dahboard ...i donot know where exactly to add this lines in this file...

  • Please take a look at the code and look at how the existing menu entries are registered. I really can't give you any useful further advice because the position to add the new code for your additional menu entry depends on where exactly you want the new menu entry to appear on your site. Please take the time to figure that out yourself. You can't break anything. If the page doesn't load, just replace your modified start.php with the original start.php and try again until you got it working.

    And as I already mentioned in my first posting I would strongly advice against using the Facebook theme anyway. This plugin is no longer supported, i.e. you won't be able to upgrade to a newer version of Elgg (and Elgg 1.8 is totally outdated and no longer supported). Additionally, the Facebook theme contains bug that were never fixed (and I never came across another Facebook-like theme that was created based on the original Facebook theme that fixed all the bugs - even more so likely introduced other bugs). If your only reason to stick on Elgg 1.8 is the Facebook theme or maybe another plugin not available on newer versions of Elgg then I would suggest to look for alternatives to these plugins because you will gain much more when upgrading to newer Elgg versions (with other nice themes available) than sticking on Elgg 1.8 forever.

Performance and Scalability

Performance and Scalability

If you've got a need for speed, this group is for you.