Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 16 Aug 2011, 04:53
kau kau is offline
 
Join Date: Jul 2002
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.
Reply With Quote
  #2  
Old 16 Aug 2011, 12:41
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
Reply With Quote
  #3  
Old 16 Aug 2011, 15:41
kau kau is offline
 
Join Date: Jul 2002
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.
Reply With Quote
  #4  
Old 16 Aug 2011, 15:46
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
Reply With Quote
  #5  
Old 16 Aug 2011, 16:39
kau kau is offline
 
Join Date: Jul 2002
I've tried in a template and navbits/navbit_complete hooks.
Reply With Quote
  #6  
Old 16 Aug 2011, 16:43
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
Reply With Quote
  #7  
Old 16 Aug 2011, 17:02
kau kau is offline
 
Join Date: Jul 2002
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.
Reply With Quote
  #8  
Old 16 Aug 2011, 17:21
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
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.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 04:02.

Layout Options | Width: Wide Color: