vBulletin ModsThe Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=226914 |
No, you do not need to create your own vB page to use it. Right now, your code shows that your tab should be selected when you are on a page where THIS_SCRIPT is defined as podcast. Perhaps you meant to use something like this instead?
|
Quote:
with
I tried this but get a PARSE error. Maybe that's where I'm getting confused. How do you define a page as something like 'podcast'? |
If you replaced it with exactly what you wrote, then yes, you will get a parse error because you are missing the end parenthesis.
At the top of each vb page is something like this:
That defines the page name. So, if you are going to have the tab highlight because you are on a specific page, that is the best method to use. But, you can use other valid conditions also as long as they don't interfere with the conditions to have another tab highlighted. |
Quote:
|
Quote:
17 in the online.php page. And line 17 of the forum.php page defines THIS_SCRIPT for that page to be 'index'. And for content.php, THIS_SCRIPT is defined at 'vbcms'. I believe any page in vb that you can land on has got THIS_SCRIPT defined at the top. And you don't want to replace those lines, I'm not sure why you would think you would want to do that. Those lines are there so you can write conditions like the one I use for when you are on that page. If you wrote your own page, you would give it your own definition for THIS_SCRIPT. |
I'm sorry if I'm making this out to be more complicated than it needs to be, but I must be missing something. Here is your code from the first page:
I replaced 'yourpage' with 'podcast', and 'unique_name' with 'podcast'. I also changed the 'Nav Link' href and name at the bottom of the script to look like:
It appears to me that these are the only changes required. What I don't understand is where I'm suppose to find the define('THIS_SCRIPT', '<name>');. You said it's at the top of the page, so I went to the actual podcast CMS page I created and looked at the Page Source in my browser but this code doesn't exist. So where is it located? |
THIS_SCRIPT is defined at the top of the php page, not some browser page, but in the actual code. Open up the file called forum.php that you downloaded from vbulletin.com to install on your server and you will see the line I am talking about.
I don't think (or rather, I don't know of the condition) you can do this for a CMS page. All those pages are using the content.php page and right now, if you are on a content.php page, the Home link is highlighted. I don't know what the condition is for a particular Article, which is what it sounds like you want to do. You'd have to look in through the code to figure that out and I haven't got that far into the CMS yet. |
So you're saying I do need to create a custom vBulletin page, and this NavBar technique can't work with a CMS created page, right?
|
Quote:
|
1 Attachment(s)
Lovely it works like a charm, lynne to the rescue ;)
:D |
It work in RC2?? because the selected function and the drop down menu doesn't appear for me.
|
Quote:
|
on my RC2 the function selected doesn't work....
|
Quote:
|
This is what i use
But when the page is selected the button doesn't work properly. |
All times are GMT. The time now is 22:50. |
Powered by vBulletin® Version 3.8.14
Copyright © 2021, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.