• Welcome to Simple Machines Community Forum. Please login or sign up.
September 28, 2021, 12:49:06 PM

News:

SMF 2.0.18 has been released! Please update. Read more.


How to add a tab in the Main Theme in SMF2

Started by Thephatrican, August 19, 2008, 11:55:43 PM

Previous topic - Next topic

Thephatrican

August 19, 2008, 11:55:43 PM Last Edit: August 20, 2008, 12:20:30 AM by Thephatrican
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.

Halo 3 Community
[nofollow]

Nathaniel

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.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Thephatrican


Halo 3 Community
[nofollow]

Advertisement: