Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: MultiformeIngegno on August 20, 2008, 09:48:49 AM

Title: Managing menu tabs
Post by: MultiformeIngegno on August 20, 2008, 09:48:49 AM
Hi! :)
I'd like to add a new tab that links to the root of the site, called "home".
But there's already a button called "home" that linmks to the home of the forum... so i'd like to rename the existent button "home" to "forum" and create a new button called "home" that links to the root...

I've read this faq (http://docs.simplemachines.org/index.php?topic=564) but it doesn't work with smf 2!!

Please help me!!
Title: Re: Managing menu tabs
Post by: cme1st2302 on August 20, 2008, 10:31:42 AM
attach you index.template.php and I will help you out
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on August 20, 2008, 11:10:06 AM
Here you are.. :)
Title: Re: Managing menu tabs
Post by: cme1st2302 on August 20, 2008, 11:20:54 AM
Sorry, I wasn't aware you were using SMF 2.0.  Please attach your subs.php file.

Is the home page you want to link to the one in your signature?
Title: Re: Managing menu tabs
Post by: N3RVE on August 20, 2008, 11:49:14 AM
Hello lorenzone92,
./Sources/Subs.php controls the buttons but requires the button labels from a language file
./Themes/default/languages/index.english.php
Download the files via FTP (How do I use FTP? / What is FTP? (http://docs.simplemachines.org/index.php?topic=480))
Open with wordpad, press Ctrl + F -> Type in home, you would arrive at the label
Code: [Select]
$txt['home'] = 'Home';Right after that add,
Code: [Select]
$txt['Forum_home'] = 'Forum';
In Subs.php, do a search for 'home' ->
Code: [Select]
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),

Duplicate that block of code, replace these in the duplicated block.
Forum Button
Code: [Select]
'title' => $txt['Forum_home'],
'href' => $scripturl,
Home Button
Code: [Select]
'title' => $txt['home'],
'href' => Your-URL,

-[n3rve]
Title: Re: Managing menu tabs
Post by: cme1st2302 on August 20, 2008, 12:33:58 PM
Yeah what he said!!  Nice avatar n3rve!!
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on August 20, 2008, 06:17:40 PM
Mmh.. I've done what you said, here's my part of Subs.php edited:

Code: [Select]
$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => www.rockciclopedia.com,
'show' => true,
'sub_buttons' => array(
),
),

'home' => array(
'title' => $txt['Forum_home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),

'help' => array(
'title' => $txt['help'],

And here's the poart of index.english.php:
Code: [Select]
$txt['home'] = 'Home';
$txt['Forum_home'] = 'Forum';

now the forum looks:
(http://img337.imageshack.us/img337/4742/buttonsih7.png)

The new "Forum" button isn't displayed and the old "Home" button is... blank..
Title: Re: Managing menu tabs
Post by: ccbtimewiz on August 20, 2008, 08:46:10 PM
The second instance.

Code: [Select]
'home' => array(
'title' => $txt['Forum_home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),

Should be:
Code: [Select]
'forum' => array(
'title' => $txt['Forum_home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),
Title: Re: Managing menu tabs
Post by: N3RVE on August 21, 2008, 04:40:34 AM
The button is there but missing it's label.
Follow ccbtimewiz's instruction, sorry for that little errror

-[n3rve]
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on August 21, 2008, 05:27:34 AM
Mmmh.. no..
Now the forum looks:

(http://img223.imageshack.us/img223/3351/buttons2nh4.th.png) (http://img223.imageshack.us/my.php?image=buttons2nh4.png)

I've attached my Subs.php and index.english.php...
Title: Re: Managing menu tabs
Post by: N3RVE on August 21, 2008, 11:06:10 AM
Hello lorenzone92,
Wondering why it didn't work for you,
Attached are two files I tested out here (http://oxynerve.net/forums/index.php).

Remember to rename them ;)

-[n3rve]
Title: Re: Managing menu tabs
Post by: RL Joneson on August 21, 2008, 02:04:11 PM
Hey lorenzone I asked the same question months ago and got some good steps to follow. Just add a new button for your Home to your root site, then change the current Home button to say something like "Forum" or whatever you are using the forum for. Here's the link to my post. This should help if you still have any questions.

http://www.simplemachines.org/community/index.php?topic=232743.msg1497836#msg1497836 (http://www.simplemachines.org/community/index.php?topic=232743.msg1497836#msg1497836)
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on August 21, 2008, 07:10:29 PM
Hello lorenzone92,
Wondering why it didn't work for you,
Attached are two files I tested out here (http://oxynerve.net/forums/index.php).

Remember to rename them ;)

-[n3rve]
Nice!!! ;)
With those files it works: http://forum.rockciclopedia.com !!!

Really thanks!!!! :) :)
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on August 21, 2008, 07:13:55 PM
Ah Nerve, very last thing.. :P
The active button should be "forum", not "home"... O:)
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on August 23, 2008, 07:37:11 PM
Ah Nerve, very last thing.. :P
The active button should be "forum", not "home"... O:)
If you fix this thing I'll venerate you for ever... :P
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on August 24, 2008, 05:17:06 PM
Resolved on my own!! ;)
Hey don't worry, I'll venerate you anyway!!! :P
Title: Re: Managing menu tabs
Post by: jazz1 on September 01, 2008, 02:17:48 PM
Hello, worked for me too, BUT

This problem is not fully solved!


When viewing the forum at the Forum_home it should be seen that the current page is FORUM and not HOME like it can be seen now

Is it any possibility to change it?
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on January 25, 2009, 05:29:45 AM
I need another answer.. :D

I'd like to create a separator like this "----" between two tabs...
If I add:

         'home' => array(
            'title' => -----
            'href' => NOBODY HERE,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),

where "nobody here" is... nothing (:P) it shows properly this "----" but it points to the forum home..
I'd like to make it without any link..

Thanks!! :D
Title: Re: Managing menu tabs
Post by: MultiformeIngegno on February 08, 2009, 08:54:34 AM
No one can help me? :)