News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Managing menu tabs

Started by MultiformeIngegno, August 20, 2008, 09:48:49 AM

Previous topic - Next topic

MultiformeIngegno

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 but it doesn't work with smf 2!!

Please help me!!
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

cme1st2302

attach you index.template.php and I will help you out
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

MultiformeIngegno

RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

cme1st2302

#3
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?
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

N3RVE

#4
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?)
Open with wordpad, press Ctrl + F -> Type in home, you would arrive at the label
$txt['home'] = 'Home';
Right after that add,
$txt['Forum_home'] = 'Forum';


In Subs.php, do a search for 'home' ->

'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

'title' => $txt['Forum_home'],
'href' => $scripturl,

Home Button

'title' => $txt['home'],
'href' => Your-URL,


-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

cme1st2302

Yeah what he said!!  Nice avatar n3rve!!
SMF Version: 1.1.11
SimplePortal Version: 2.3.2

Admin

He who waits for perfect conditions sees nothing!!
If you need help adding a button or tab PM me!!

MultiformeIngegno

Mmh.. I've done what you said, here's my part of Subs.php edited:

$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:
$txt['home'] = 'Home';
$txt['Forum_home'] = 'Forum';


now the forum looks:


The new "Forum" button isn't displayed and the old "Home" button is... blank..
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

ccbtimewiz

The second instance.

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


Should be:
'forum' => array(
'title' => $txt['Forum_home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
),


N3RVE

The button is there but missing it's label.
Follow ccbtimewiz's instruction, sorry for that little errror

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

MultiformeIngegno

Mmmh.. no..
Now the forum looks:



I've attached my Subs.php and index.english.php...
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

N3RVE

#10
Hello lorenzone92,

Wondering why it didn't work for you,
Attached are two files I tested out here.


Remember to rename them ;)

-[n3rve]
Ralph "[n3rve]" Otowo
Former Marketing Co-ordinator, Simple Machines.
ralph [at] simplemachines [dot] org                       
Quote"Somewhere, something incredible is waiting to be known." - Carl Sagan

RL Joneson

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

MultiformeIngegno

Quote from: [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.


Remember to rename them ;)

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

Really thanks!!!! :) :)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

MultiformeIngegno

Ah Nerve, very last thing.. :P
The active button should be "forum", not "home"... O:)
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

MultiformeIngegno

Quote from: lorenzone92 on August 21, 2008, 07:13:55 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
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

MultiformeIngegno

Resolved on my own!! ;)
Hey don't worry, I'll venerate you anyway!!! :P
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

jazz1

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?

MultiformeIngegno

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
RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

MultiformeIngegno

RockCiclopedia (wiki - forum), Tutta la storia del rock, scritta da voi ...
Rimanere aggiornati sul mondo della musica grazie al nuovo feed "RockCiclopedia Music News"!

Advertisement: