SMF Support > SMF 2.0.x Support

How to add menu item in simple machines forum

<< < (2/2)

JohnS:
Your code is wrong, if you want a simple link back to a website then you can use something like the code below, the mlist array is already there you just have to add the cpost array after it, or after the button you want it to appear after.

--- Code: ---'mlist' => array(
title' => $txt['members_title'],
'href' => $scripturl . '?action=mlist',
'show' => $context['allow_memberlist'],
'sub_buttons' => array(
     'mlist_view' => array(
                'title' => $txt['mlist_menu_view'],
'href' => $scripturl . '?action=mlist',
'show' => true,
),
     'mlist_search' => array(
     'title' => $txt['mlist_search'],
     'href' => $scripturl . '?action=mlist;sa=search',
     'show' => true,
     'is_last' => true,
     ),
            ),
),
'cpost' => array(
'title' => 'Website',
               'href' => 'http://yoursite.com',
'show' => true,
'sub_buttons' => array(
),
),
--- End code ---

subrata:
Thanks john it is solved  8)

keyrocks:

--- Quote from: Storman™ on May 07, 2012, 08:17:19 AM ---Instead of messing about with your code why not just add a simple mod that does all that hard work for you.
A mod like this would do the job much easier and let you add buttons to your menu.

--- End quote ---

The Menu Editor Lite mod is great... provided you haven't added other Mods beforehand that have also added menu items to the top menu bar.

In my case, I have Tiny Portal and a Blogs mod installed. After installing the Menu Editor mod - the menu items for TP disappeared. I checked in the modded ./Sources/Subs.php file and the menu mods for both TP and Blogs are still intact... but Menu Editor Lite does not include them.

I'd like to keep the Menu Editor Lite mod but to do that I need to figure out how to get the TP and Blogs menu items back in place... as well as any others that might get added with new mod installs later.

In the end I may find it easier to add a hard-coded link where I need it as suggested by JohnS.

Navigation

[0] Message Index

[*] Previous page

Go to full version