Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Airborne328 on January 16, 2012, 03:59:22 PM

Title: Menu Buttons "InsidiousII
Post by: Airborne328 on January 16, 2012, 03:59:22 PM
Afternoon all,  I searched and found nothing specific to my issues.

1.  I am trying to simply remove some of the menu buttons, i.e. help etc, so they are not making double rows to fit.  For the life of me I cannot find where they are within the "index.template.php.

I removed the file and refreshed page and they were gone, so I know there on there some wheres.

I cannot find support for this theme, so I was wondering if I could ask for some assistance in locating these edits.  index.template attached.

Thanks in advance for any help.

smf version 2.0.2
ezportal 0.6.0
http://www.combatlifesavers.us

Title: Re: Menu Buttons "InsidiousII
Post by: The Craw on January 16, 2012, 04:22:06 PM
In 2.0, the menu is controlled by an array in Subs.php, toward the bottom of the file.

Search and Destroy

'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),
Title: Re: Menu Buttons "InsidiousII
Post by: Matthew K. on January 16, 2012, 04:27:14 PM
Here's a better approach...

./Sources/Subs.php:
Code (Find) Select
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),

Code (Replace) Select

'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => $user_info['theme'] == 0 ? true : '',
'sub_buttons' => array(
),
),

That will only show the 'help' button in the SMF Curve (default) theme.
Title: Re: Menu Buttons "InsidiousII
Post by: Airborne328 on January 16, 2012, 06:05:32 PM
Guess I have been out of the loop.  These things used to be in the index.template.  Much thanks for the assistance, and the edit affected ALL themes, which is what I needed.
Title: Re: Menu Buttons "InsidiousII
Post by: Matthew K. on January 16, 2012, 06:08:53 PM
The best way to hide a menu button is to change 'show' => true, to 'show' => '', so that you don't lose the code if you ever need to add it back. :)
Title: Re: Menu Buttons "InsidiousII
Post by: Airborne328 on January 16, 2012, 08:47:46 PM
thanks
Title: Re: Menu Buttons "InsidiousII
Post by: Matthew K. on January 16, 2012, 08:48:08 PM
Not a problem, take care! :)