TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 195,831
  • Total Topics: 21,287
  • Online today: 86
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 90
  • Total: 90

"Active Tab"

Started by jehod, February 16, 2007, 11:01:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jehod

Hi,

I recently added a new main menu item in my forum which links to an article instead of a "?action=" line.

An example of my code:

// Show the [Squads] button.
echo ($current_action == 'squads' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'squads' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?page=39">Squads</a>
</td>' , $current_action == 'squads' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


When I click on my new menu item, it takes me to the article as expected, however the tab is not "active", the home tab is. So I'm wondering, is there a way to get this new menu item to show as active?

I appreciate any help.

akulion

ull have to add it to the butons array


if (in_array($context['current_action'], array('links','search', 'admin', 'arcade','calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm', 'forum', 'tpadmin')))
$current_action = $context['current_action'];


in the above ull have to put in squads anywhere like this

'links','search', 'admin', 'squads', 'arcade','calendar',

jehod

Thanks for the suggestion. I checked that line and it appears to already be in place. Here's my code:

if (in_array($context['current_action'], array('search', 'arcade', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'squads', 'staff', 'pm', 'forum', 'tpadmin')))
$current_action = $context['current_action'];


Can you think of anything else that I might be overlooking?

IchBin

In your URL when you access the squads page does is actually have index.php?action=squads  ???

If not, that is why it won't be active. It actually has to be defined as an action for it to pick up the place you are in the forum in order to make the "Active Tab".

jehod

#4
Nope, it goes directly to the article "page=x". Is there some way to make it work with my article?

Edit:  I do see what you mean by it having to be "action=" to kick in.

IchBin

I don't know of any way to make an article work with the current action.

jehod

Ok, thanks anyways though. What I will probably have to do is move my code off the article so I can use an action.


akulion

u know when bloc comes back we could ask him about this

Since I think it wont be that hard to define an array for Page=

It should be the same way as the index, Ill try and study it in his absence to see if I can come up with something. If not then maybe he can help us with it.

aku

This website is proudly hosted on Crocweb Cloud Website Hosting.