Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Thephatrican on August 19, 2008, 11:55:43 PM

Title: How to add a tab in the Main Theme in SMF2
Post by: Thephatrican on August 19, 2008, 11:55:43 PM
I have searched the Documents, but I cannot seem to find the answer for SMF 2. How would I be able to add my own manual link before the 'Home' link (to the left of it if read in order). This is for the default skin.

I would greatly appreciate this help.
Title: Re: How to add a tab in the Main Theme in SMF2
Post by: Nathaniel on August 20, 2008, 12:12:39 AM
You need to edit the "setupMenuContext()" function from your Subs.php file.

Find this code:
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),


Add this code (or similar) beforehand.
'yourtab' => array(
'title' => 'My Title',
'href' => 'http://www.domain.com',
'show' => true,
'sub_buttons' => array(
),
),


If you want this button to show as active for a certain SMF action, then you will need to set the 'yourtab' part to the action. Remember to replace the 'My Title' and 'http://www.domain.com' values with your relevant values.
Title: Re: How to add a tab in the Main Theme in SMF2
Post by: Thephatrican on August 20, 2008, 12:20:20 AM
Thank you so much for your quick help!