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: 196,004
  • Total Topics: 21,330
  • Online today: 488
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 90
  • Total: 90

How do you do this??

Started by pvcblue, November 01, 2006, 01:41:20 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pvcblue

I have added a itemlink to the top menu - how do you make it so when it is clicked it is "highlighted"??
Like shown below -

borgBOB

I cannot say for certain without seeing the code you used to display your new menu item, but look very closley at how these are generated in the default theme.
Specifically, look at "// Show the start of the tab section." and how each button is created.

pvcblue

this is the code I used -

// the [downloads] button
echo ($current_action=='tpmod;dl=0' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'tpmod;dl=0' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=tpmod;dl=0">' , $txt[115]  , '</a>
</td>' , $current_action == 'tpmod;dl=0' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

borgBOB

Try adding 'tpmod;dl=0' to the variables in the array listed below.

Also I think 'tpmod;dl' might work verses 'tpmod;dl=0'.

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

pvcblue


akulion

#5
try to put:

$current_action == 'tpmod'
in all places in the code

and in array ,'tpmod'

IF the above dosent work try and follow this thread

pvcblue

tried and followed - didn't work
:( :/

IchBin

depends on if you are trying to setup a link that has an action or not. tpmod would only work for the downoad button because the action in the URL is action=tpmod

If you're trying to link to something that doesn't have an action set in your forum then it won't highlite the button like the others do.

Nokonium

Oh bummox, can't get it to show as active tab, as it is a subaction

Got this far

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

    // The [download manager]!
        if ($context['TPortal']['show_download'])
                echo ($current_action == 'tpmod;dl' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
                                <td valign="top" class="maintab_' , $current_action == 'tpmod;dl' ? 'active_back' : 'back' , '">
                                        <a href="', $scripturl, '?action=tpmod;dl">' , $txt['tp-downloads'] , '</a>
                                </td>' , $current_action == 'tpmod;dl' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

IchBin

Mind you this will work for ALL modules in the future for TP if they continue to be sub-action of tpmod. But this will work for download manager for now.

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

    // The [download manager]!
        if ($context['TPortal']['show_download'])
                echo ($current_action == 'tpmod' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
                                <td valign="top" class="maintab_' , $current_action == 'tpmod' ? 'active_back' : 'back' , '">
                                        <a href="', $scripturl, '?action=tpmod">' , $txt['tp-downloads'] , '</a>
                                </td>' , $current_action == 'tpmod' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

This website is proudly hosted on Crocweb Cloud Website Hosting.