Need help with adding menu items

Started by cowboytns, June 29, 2010, 10:13:49 AM

Previous topic - Next topic

cowboytns

I am trying to add items to the menu in my forum.  I am using the Luxemburgues theme.  I followed the instructions on how to add a menu tabs to SMF 2.0 post (http://www.simplemachines.org/community/index.php?topic=261880.0).  However, when I try to add items between "home" and "help" the text that I entered in the subs.php array doesn't show up.  But there is something there, when you hover over the area where I put the item the button highlights and the link works...here is a picture:



Okay so I can't get the picture to load...but you can go to http://brainmush.net/forum2 to see what I am talking about.

If I put the item after "search" it works...but I want them after "Home" can someone help me please.

Here is the code that I edited in the subs.php file:
// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
{
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => 'http://brainmush.net',
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
// 'target' => '_blank',
),
                       
'forumindex' => array(
'title' => $txt['forum index'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),
                       
'newsfeeds' => array(
'title' => $txt['news links'],
'href' => 'http://brainmush.net/news',
'show' => true,
'sub_buttons' => array(
'RSSfeeds' => array(
'title' => $txt['RSS news feeds'],
'href' => 'http://brainmush.net/news',
'show' => true,
                                                'target' => _blank,
),
),
),

                        'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
                       
'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),

'admin' => array(
'title' => $txt['admin'],
'href' => $scripturl . '?action=admin',
'show' => $context['allow_admin'],
'sub_buttons' => array(
'featuresettings' => array(
'title' => $txt['modSettings_title'],
'href' => $scripturl . '?action=admin;area=featuresettings',
'show' => allowedTo('admin_forum'),
),
'packages' => array(
'title' => $txt['package'],
'href' => $scripturl . '?action=admin;area=packages',
'show' => allowedTo('admin_forum'),
),
'errorlog' => array(
'title' => $txt['errlog'],
'href' => $scripturl . '?action=admin;area=logs;sa=errorlog;desc',
'show' => allowedTo('admin_forum') && !empty($modSettings['enableErrorLogging']),
),
'permissions' => array(
'title' => $txt['edit_permissions'],
'href' => $scripturl . '?action=admin;area=permissions',
'show' => allowedTo('manage_permissions'),
),
),
),

CapadY

#1
Isuppose you've tried to add the next part:


          'newsfeeds'   => array(
            'title' => $txt['news links'],
            'href'   => 'http://brainmush.net/news',
            'show' => true,
            'sub_buttons'   => array(
               'RSSfeeds' => array(
                  'title'   => $txt['RSS news feeds'],
                  'href' =>   'http://brainmush.net/news',
                  'show' => true,
                                                  'target' => _blank,
               ),
            ),
         ),


To get his working you can do 2 things:

Add the next code in /themes/default/language/modifications.yourlanguage.php:


$txt['news links'] = 'News Links';
$txt['RSS news feeds'] = 'RSS News Feeds';


Or change the modification in subs.php to:

         'newsfeeds'   => array(
            'title' => 'news links',
            'href'     => 'http://brainmush.net/news',
            'show' => true,
            'sub_buttons'     => array(
               'RSSfeeds' => array(
                  'title'     => 'RSS news feeds',
                  'href' =>   'http://brainmush.net/news',
                  'show' => true,
                                                  'target' => _blank,
               ),
            ),
         ),
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

NanoSector

And some of your tabs do not show up.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

CapadY

I think he'll have to count his brackets :)
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

cowboytns

thanks capady that worked!

by the way do you know where I can change the settings for which menu button is highlighted.  As you could tell from the code I changed home to be my webpage home so when I am on the forum index I want the background for the "forum index" to be red...not the "home" button.

NanoSector

I did mark this as solved for you.

If you may be against this, be sure to unmark it ;)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

cowboytns

I unmarked it because I would like help with my second question...I promise it's the last one then I will mark it as solved.

CapadY

Quote from: cowboytns on June 29, 2010, 10:44:05 AM
thanks capady that worked!

by the way do you know where I can change the settings for which menu button is highlighted.  As you could tell from the code I changed home to be my webpage home so when I am on the forum index I want the background for the "forum index" to be red...not the "home" button.

No, I don't know. As a matter of fact I have the same problem t this moment :D
Please, don't PM me for support unless invited.
If you don't understand this, you will be blacklisted.

NanoSector

Quote from: cowboytns on June 29, 2010, 10:50:33 AM
I unmarked it because I would like help with my second question...I promise it's the last one then I will mark it as solved.
Ok. Will unmark it again.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Advertisement: