Quote:
Originally Posted by Parture
What are we suppose to type in for THIS_SCRIPT? I tried "index".
I made link.php to read as index.php.
What specifically are we suppose to put in for "unique_name"? Can we type anything like rabbit or dog?
When I click on the forum logo the newly created Nav link shows up with its menu and submenu now instead of the forum.php forum tab and its menu.
But when I click back on the forums tab it does not highlight nor do its menu show up, but the newly created Nav bar link with its menus remain highlighted.
Help.
|
What is your goal here? When do you want this tab to be active? You want it active when a user is on the forum.php page (that one is defined as "index")? That will be a bit weird since you click the Forum tab and it goes to forum.php but you aren't going to have the Forum tab highlighted this way because the "index" page also the same as the the main entry page for you when the Forums link comes up active? If so, that condition may be a bit weird in which case you may want to change it to be something a bit more unique. So, first we need to define when you want that tab to be Active.
Quote:
Originally Posted by skylab
Hi Lynne,
I've copied the whole code and only changed link.php to another page, but it still does not 'select' itself on the navbar. I tried with a few unique names and such. No go. Here's the code I've tried.
Code:
global $template_hook;
$tabselected = '';
$tablinks = '';
if (THIS_SCRIPT == 'eventslink1')
{
$vbulletin->options['selectednavtab']='eventslink2';
$tabselected = ' class="selected"';
$tablinks = ' <ul class="floatcontainer">
<li><a href="link1.php">Link 1</a></li>
<li class="popupmenu">
<a href="javascript://" class="popupctrl">Drop Down</a>
<ul class="popupbody popuphover">
<li><a href="sublink1.php">SubLink 1</a></li>
<li><a href="sublink2.php">SubLink 2</a></li>
<li><a href="sublink3.php">SubLink 3</a></li>
</ul>
</li>
<li><a href="link2.php">Link 2</a></li>
<li><a href="link3.php">Link 3</a></li>
</ul> ';
}
$template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="calendar.php">Calendar</a>'.$tablinks.'</li>' ;
Thanks again for all your help lately. Don't know what VB would do without ya 
|
Same with you.... went do you want this tab to be Active? That is the condition you need to write. Most people want it active when they are on a specific page. At the top of that vbulletin page, THIS-SCRIPT is defined like this:
PHP Code:
define('THIS_SCRIPT', 'a_page_name');
In this case, your condition would be:
PHP Code:
if (THIS_SCRIPT == 'a_page_name')
The condition does NOT have to be based on THIS_SCRIPT, but it DOES have to be UNIQUE to that tab.