TinyPortal

Development => Support => Topic started by: Riot on April 17, 2008, 06:48:01 PM

Title: menu items not showing active state
Post by: Riot on April 17, 2008, 06:48:01 PM
Not sure if this is theme related or general support, I found this "Active Tab" (http://www.tinyportal.net/index.php?topic=13326.0) after searching but instead of re-activating a long dead thread I started a new one.

I am running SMF 1.14 & TP v0.9.8
http://rightcoastracing.com/SMF/index.php

I have added new items to the menu via the Extra buttons in the theme settings, they are in the menu, they take you to the right place but they don't keep there active state.

here is the code from my index.template.php
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('video','links','downloads','gallery','admin', 'managegames', 'arcadesettings', 'arcadecategory', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('video','links','downloads','gallery','search', 'arcade', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'globalAnnouncementsAdmin')
$current_action = 'admin';

if ($context['current_action'] == 'search2')
$current_action = 'search';

// Additional buttons
if ($context['current_action'] == 'video')
$current_action = 'video';
if ($context['current_action'] == 'links')
$current_action = 'links';
if ($context['current_action'] == 'downloads')
$current_action = 'downloads';

if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';


This is what I have them set as in the theme.settings

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Frightcoastracing.com%2Fimages%2Friot%2FextraButtons.gif&hash=9e6348bee308e8199931835258cc8d4281bbccd6)

If there is any other info you need I will try and get it asap for you thanks! 
No huge rush as the site is still in development.

Title: Re: menu items not showing active state
Post by: IchBin on April 17, 2008, 09:24:50 PM
You shouldn't need to alter the code in the index. You added all 3 of your links active state (current_action) to the home array and admin array. Remove your coding from the index.template.php.
Title: Re: menu items not showing active state
Post by: Riot on April 17, 2008, 09:32:58 PM
Removed all code that I had put in the index.template.php  still no active states

Just to verify, you wanted everything out, even the additions I did to the arrays?
Title: Re: menu items not showing active state
Post by: IchBin on April 17, 2008, 09:34:29 PM
Yes, I wanted you to remove your code from the array.
Title: Re: menu items not showing active state
Post by: Riot on April 17, 2008, 09:38:56 PM
done, still no active state.
Title: Re: menu items not showing active state
Post by: IchBin on April 17, 2008, 10:14:49 PM
Seems your site is down, so I can't look at it.
Title: Re: menu items not showing active state
Post by: Riot on April 17, 2008, 11:32:04 PM
that is odd...back up now.
Title: Re: menu items not showing active state
Post by: IchBin on April 18, 2008, 01:58:09 AM
Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.
Title: Re: menu items not showing active state
Post by: Riot on April 18, 2008, 12:24:57 PM
Really?  I just cleared my cache and it is still fine, I will check when I get to the office.

http://rightcoastracing.com/SMF/index.php
Title: Re: menu items not showing active state
Post by: G6Cad on April 18, 2008, 01:08:42 PM
QuoteTemplate Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.
Title: Re: menu items not showing active state
Post by: G6Cad on April 18, 2008, 01:39:20 PM
We are all using firefox here ;)
Title: Re: menu items not showing active state
Post by: Riot on April 18, 2008, 01:40:51 PM
Yeah? but even after clearing my cache it was still working in FF...I don't get it.
Title: Re: menu items not showing active state
Post by: G6Cad on April 18, 2008, 02:55:13 PM
Cleare cache, temp internet files and cookies then precc ctrl and F5 at the same time
Title: Re: menu items not showing active state
Post by: Riot on April 18, 2008, 02:58:26 PM
Well now it is working on both i.e. and FF.  Are you still getting a template error?

But there is still no active state, on I.E. or FF, mac or PC
Title: Re: menu items not showing active state
Post by: Smoky on April 18, 2008, 04:30:27 PM
Template Parse Error!
It seems something has gone sour on the forum with the template system. This problem should only be temporary, so please come back later and try again. If you continue to see this message, please contact the administrator.

You can also try refreshing this page.

this may be due to a theme not behaving right..  ;)
Title: Re: menu items not showing active state
Post by: Riot on April 18, 2008, 04:34:18 PM
Nope I was messing with something when you checked it.  Thanks anyway.
Title: Re: menu items not showing active state
Post by: Smoky on April 18, 2008, 04:56:25 PM
glad you got it working..   :D
Title: Re: menu items not showing active state
Post by: Riot on April 18, 2008, 05:07:15 PM
Oh the active state still isn't working
Title: Re: menu items not showing active state
Post by: Riot on April 18, 2008, 07:22:43 PM
Almost got this working thanks for the help
Title: Re: menu items not showing active state
Post by: IchBin on April 18, 2008, 08:57:31 PM
Of the three, the download is the only one not working. And that would be because its not action=download. Its action=tpmod;dl. You'll have to add some code manually to the theme instead if you want the button to work like the others. That theme setting for the button will not know how to do it.
Title: Re: menu items not showing active state
Post by: Riot on April 18, 2008, 09:12:13 PM
Yeah that one is being a pain..oh well to nice out to mess with code right now.  Thanks again.