vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Variable to Test for NAVBAR (https://vborg.vbsupport.ru/showthread.php?t=268608)

kau 08-16-2011 02:53 AM

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.

kh99 08-16-2011 10:41 AM

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.

kau 08-16-2011 01:41 PM

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.

kh99 08-16-2011 01:46 PM

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.

kau 08-16-2011 02:39 PM

I've tried in a template and navbits/navbit_complete hooks.

kh99 08-16-2011 02:43 PM

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.

kau 08-16-2011 03:02 PM

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.

kh99 08-16-2011 03:21 PM

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.


All times are GMT. The time now is 05:59 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00898 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete