The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Navbar Tab Addition for CMS Sections - Highlighting
Hello,
I have created several new Navbar tabs linking to different CMS sections using the solution found here: https://vborg.vbsupport.ru/showthread.php?t=226914 The tabs work great, but do not highlight when selected. Instead, "Home" remains highlighted. I've been working with this for a while without any luck. I understand that I must define a condition for the highlighting to work but since these are all CMS section pages THIS_SCRIPT always = 'vbcms' for all of the section pages, so this is not a unique condition. I have also tried to define the URL several different ways using both standard URLs and Friendly URLs without success. Here is an example of the plugin code I'm trying to use for a "Contact" tab: $tabselected = ''; $tablinks = ''; if (THIS_SCRIPT == 'Contact') { $vbulletin->options['selectednavtab']='Contact'; $tabselected = ' class="content"'; } $template_hook['navtab_end'] .= '<li'.$tabselected.'><a class="navtab" href="content.php/102-Contact">Contact</a>'.$tablinks.'</li>' ; I have also tried to define "THIS_SCRIPT ==" as all variants of the actual URL as well as R= etc. Does anyone happen to have any advice regarding the proper way to define a unique variable for the section pages of the CMS? Thanks in advance for any input! |
#2
|
||||
|
||||
You need to change the condition for highlighting the Home tab (in the vBulletin CMS product - Navbar: Insert CMS Navbar Entry plugin) to exclude highlighting it under the conditions you want the other tabs to show as highlighted.
|
#3
|
|||
|
|||
Hello and thanks for the reply!
Could you please give an example of how to access the URL (or RELPATH) from within the plugin? That is the only condition that I can find that differs among the Home tab & the other tabs that I have created. When I attempt it now, the value of RELPATH is blank, so there is no condition that is true on the created tabs but not the Home. Any help or ideas you give would be greatly appreciated. |
#4
|
||||
|
||||
This is not valid for a content.php page:
PHP Code:
|
#5
|
|||
|
|||
Lynne,
I used $_GET['r'] as the unique condition, combined with the Navbar: Insert CMS Navbar Entry suggestion, and everything is working perfectly. Thanks so much for your help; I really appreciate it! Aaron |
#6
|
||||
|
||||
Glad you got it working.
|
#7
|
|||
|
|||
Hello, lol Can you tell me how managed this. Im not too familiar with php yet. Im at the same problem you had. Can you post the code?
|
#8
|
||||
|
||||
If you click to view a page in the CMS and look at the URL, you will see something like "r=1-the-front-page". The $_GET['r'] variable is "1-the-front-page". Although it's easier to use intval and just use the number. So, a condition could be:
PHP Code:
|
#9
|
|||
|
|||
Ok I get it now but im not too familiar on how I can execute the code that will un-highlight the Home Tab if Im on the News Tab.
This is my custom New Tab plugin PHP Code:
I have this on my Navbar: Insert CMS Navbar Entry plugin PHP Code:
PHP Code:
|
#10
|
||||
|
||||
This is the line you needed to modify to exclude your own condition:
PHP Code:
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|