News:

Join the Facebook Fan Page.

Main Menu

Adding a menu button

Started by PacMan, May 03, 2008, 05:39:02 AM

Previous topic - Next topic

PacMan

I've just installed the new v2 beta.  I have flashchat on my older 1.1 board and would like to bring it along into v2.  How do I add th button in V2.  In v1.1 it was easy to do by adding the code to index.template.php but v2 is not the same.   Any help or direction is very appreciated.  Thanks.
4 stages of manhood. 1st we belive in Santa.. 2nd we find out Santa is not real. 3rd we learn to play we are santa and 4th We suddenly look like santa! ....  :)....  Merry Christmas!

H

I've been meaning to add a guide about this.

Basically open Sources / Subs.php and find:

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


You can copy one of the buttons that already exists and then modify it accordingly.
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

PacMan


Awesome!  Thank you so much.


Quote from: H on May 03, 2008, 06:08:11 AM
I've been meaning to add a guide about this.

Basically open Sources / Subs.php and find:

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


You can copy one of the buttons that already exists and then modify it accordingly.
4 stages of manhood. 1st we belive in Santa.. 2nd we find out Santa is not real. 3rd we learn to play we are santa and 4th We suddenly look like santa! ....  :)....  Merry Christmas!

Atheo

I can add the button fine, using the Custom Action mod.  How do I change where each button links to? 

I am trying to get the HOME button to link to a custom page; create a FORUM button, link the FORUM button to the forum that is now linked (by default) to HOME.

Please help.  Thanks!

Kryptech

I may be wrong about this but I think if u put the link in the href part it will work.


'home' => array(
'title' => $txt['home'],
'href' => "www.yourHomePage.com",
'show' => true,
'sub_buttons' => array(
),

H

It should work. Try adding the http:// :)
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Atheo

Works fine but now when I am in the forum the Home button stays highlighted...any fix? 

I have found a similar fix but it is not for smf2.X

H

Do you have more than one button called home?

'home' => array(
-H
Former Support Team Lead
                              I recommend:
Namecheap (domains)
Fastmail (e-mail)
Linode (VPS)
                             

Atheo

No I do not.  I did fix it by changing:
// Default to home.
$current_action = 'home';

to:
// Default to home.
$current_action = 'forum';


But now, when I am on the HOME page the FORUM button remains highlighted   ?

This is what I have:

$buttons = array(
'home' => array(
'title' =>'home',
'href' => 'http://fit-hub.com/index.php?action=index',
'show' => true,
'sub_buttons' => array(
),
),

                        'forum' => array(
'title' => 'forum',
'href' => 'http://fit-hub.com/index.php',
'show' => true,
'sub_buttons' => array(
),
),
                       

//Switched home and forum--^


'search' => array(
'title' => $txt['search'],
'href' => $scripturl . '?action=search',
'show' => $context['allow_search'],
'sub_buttons' => array(
),
),

...etc

Atheo

I really wish someone could answer this...it is getting very annoying.

Kryptech

There is a custom action action mod for v2. It lets you add a bunch of actions to your forum, and, (I assume), will fix that small prooblem. I haven't tried the mod myself yet, but I assume if you set up the Home page as an action, and change all the original 'Home' actions to 'forum' it will work just fine. Otherwise, from looking at your code there it looks like your forum button is pointing to your Home page and your Home button is pointing to your forum action.

keagle

#11
Hi!

I created a new tab and I want to show it  not for everyone only a special member group. Can I do it? Or if it not possible than I would like to show it only registered users.


zandorgard

#12
I solved the problem here. Thanks anyway! ^^

In my case the problem was on

'title' => $txt['chat'],

I changed to

'title' => 'chat',

Thanks again!

Advertisement: