The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Variable to Test for NAVBAR
Is there a variable you can set an IF condition to, that will determine if the NAVBAR template has been called or not.
|
#2
|
|||
|
|||
It looks like every page that renders the navbar template assigns it to $navbar, so you might be able to use if ($navbar) in PHP code or <if condition="$navbar"> in a template.
|
#3
|
|||
|
|||
Thanks for the lead but I tried that one and nothing.
I even tried using a NAVBAR template hook to inject a phrase to test for that however apparently that hook loads regardless of if NAVBAR is called or not. |
#4
|
|||
|
|||
Well, where are you trying to check? If it's in a function (or a template or a hook location that's called inside a function) then you may not have access to the global variable.
|
#5
|
|||
|
|||
I've tried in a template and navbits/navbit_complete hooks.
|
#6
|
|||
|
|||
Maybe I should have asked a different question - what are you trying to do? The navbar is on most pages, are you trying to detect if ou're on a certain page? There may be a better way to do that.
|
#7
|
|||
|
|||
Certain vB pages do not call the NAVBAR. We have a page division that occurs in the NAVBAR template, then closes in the footer. If a page does not call the NAVAR, it messes the structure of the page. Therefore I need to determine in the footer, if the NAVBAR has been executed to know if I should include a variable or not.
I know I could manually do it with wrap conditions like IF SCRIPT = REGISTER, etc. but would prefer a more universal way then all these IF conditions and tracking down every script that does not call it. |
#8
|
|||
|
|||
Oh. I think the problem is that the footer template is actually rendered before the navbar template, so I can't really think of any way for that to work beyond checking for pages.
Maybe you could put in javascript that does a document.write of the closing tag, and in navbar put in some js to set a variable. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|