PDA

View Full Version : Change page selected tabs


Shamil.
09-14-2010, 04:03 PM
Hi,

How do I change which tab is given the selected attribute in the navbar on a specific page?

Lynne
09-14-2010, 04:55 PM
Usually there is a condition written around it in the code. So, you'd have to modify the condition.

Shamil.
09-14-2010, 05:29 PM
Usually there is a condition written around it in the code. So, you'd have to modify the condition.


I can't seem to find the condition. I've used this to create a custom page:
https://vborg.vbsupport.ru/showthread.php?t=228112

Lynne
09-14-2010, 06:11 PM
That's the code to create a page. There is no code in that to make a tab to go along with it.

Shamil.
09-14-2010, 07:01 PM
That's the code to create a page. There is no code in that to make a tab to go along with it.


Is there a code to set the selected tab to Home instead of Forum?

Lynne
09-14-2010, 08:26 PM
You would have to edit the plugin that creates the Home tab and include the condition for that page in there.

Shamil.
09-14-2010, 08:30 PM
Thanks Lynne, I can image that list getting slightly long :/

Lynne
09-14-2010, 09:44 PM
For custom pages? It doesn't have to be. Just define a variable (like they do THIS_SCRIPT) to be the same on each of your custom pages and use that for the condition.

Shamil.
09-14-2010, 10:10 PM
For custom pages? It doesn't have to be. Just define a variable (like they do THIS_SCRIPT) to be the same on each of your custom pages and use that for the condition.

I'm currently restructuring the navbar. I'm ending up with things like:

<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search' AND THIS_SCRIPT != 'usercp' AND THIS_SCRIPT != 'member' AND THIS_SCRIPT != 'showgroups' AND THIS_SCRIPT != 'memberlist'">

to start with.

Lynne
09-14-2010, 10:22 PM
Instead of:
<vb:if condition="!$vboptions['selectednavtab'] AND THIS_SCRIPT != 'search' AND THIS_SCRIPT != 'usercp' AND THIS_SCRIPT != 'member' AND THIS_SCRIPT != 'showgroups' AND THIS_SCRIPT != 'memberlist'">
use:
<vb:if condition="!$vboptions['selectednavtab'] AND !in_array(THIS_SCRIPT, array('search', 'usercp', 'member', 'showgroups', 'memberlist'))">