Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: mem1988 on January 05, 2011, 05:38:34 PM

Title: Menu Link Error
Post by: mem1988 on January 05, 2011, 05:38:34 PM
Hello,
I am currently running SMF 2.0 RC4 on a brand new installation.
I tried to make a new menu button like this way:
http://www.simplemachines.org/community/index.php?topic=261880.0 (http://www.simplemachines.org/community/index.php?topic=261880.0)

all works fine, the link works pretty...
...but if i go to the new site, the new menu button isn't marked as active.

Title: Re: Menu Link Error
Post by: Ashley S on January 05, 2011, 06:21:41 PM
Can you click it? Have you added a hyper link to it to make it redirect you to a php page.
Are you sure you followed the Tutorial?.
Title: Re: Menu Link Error
Post by: mem1988 on January 05, 2011, 07:19:16 PM
YES, I can click it.
NO, I didn't added a HyperLink... I've added a "?action=" Link.
YES, I'm sure I followed the Tutorial.

my problem is just that the link will not shows as "marked active"
Title: Re: Menu Link Error
Post by: Kays on January 05, 2011, 07:35:57 PM
Hi, can you post the code for that button?
Title: Re: Menu Link Error
Post by: mem1988 on January 05, 2011, 07:50:23 PM
Sources/Subs.php

$buttons = array(
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'portalseite' => array(
'title' => 'portalseite',
'href' => $scripturl . '?action=hallo',
'show' => true,
'sub_buttons' => array(
),
),
'help' => array(
'title' => $txt['help'],
'href' => $scripturl . '?action=help',
'show' => true,
'sub_buttons' => array(
),
),


and this is my code..

'portalseite' => array(
'title' => 'portalseite',
'href' => $scripturl . '?action=hallo',
'show' => true,
'sub_buttons' => array(
),
),


I think... there is maybe a part in Source or Template where I have to set "portalseite" ... ??? idk ???
Title: Re: Menu Link Error
Post by: Kays on January 05, 2011, 08:36:25 PM
Actually what you need to do make the button name the same as the action. This should work.


         'hallo' => array(
            'title' => 'portalseite',
            'href' => $scripturl . '?action=hallo',
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
Title: Re: Menu Link Error
Post by: mem1988 on January 05, 2011, 08:46:53 PM
thank you.. it works... thank you very much...
Title: Re: Menu Link Error
Post by: Kays on January 05, 2011, 09:53:16 PM
Cool, you're welcome. :)