vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   vBulletin 4 CMS parentnode and node variables (https://vborg.vbsupport.ru/showthread.php?t=289747)

brandondrury 10-27-2012 07:58 PM

vBulletin 4 CMS parentnode and node variables
 
This was an epic pain to figure out as no one seems to have a list of common variables for the CMS in vb4. Oh, the regret of using this CMS.

Anyway, if you need the variables for parentnode and node to do section dependent stuff in your templates, here they are:

PHP Code:

{vb:raw $vbulletin->nodeid

{
vb:raw $vbulletin->parentnode

It's not much, but maybe it'll save you guys the hours and hours it took me to figure out.

Action-N 01-29-2013 02:55 AM

OK well I had a heck of a time finding this post on these variables. Pulling hair myself so I wanted to share why I wanted these. Pretty much what I think should be standard, but hiding the breadcrumb only on the index/front page as it's not needed if your already there. Found someone in mod section try this with THIS_SCRIPT variable but that hid on sub pages as well. This "parentnode" did the trick an is empty when at the front page. Update since not all other pages are gonna have parentnode variable the breadcrumb was hidden on them to so had to add another condition so it only hides if it's the CMS otherwise use the original code.

Basically just go to navbar template an wrap condition statement around the whole breadcrumb code as shown.

REPLACE:
Code:

                <li class="navbithome"><a href="index.php{vb:raw session.sessionurl_q}" accesskey="1"><img src="{vb:stylevar imgdir_misc}/navbit-home.png" alt="{vb:rawphrase home}" /></a></li>
                {vb:raw navbits.breadcrumb}
                {vb:raw navbits.lastelement}

WITH:
Code:

            <vb:if condition="THIS_SCRIPT == 'vbcms'">
                <vb:if condition="$vbulletin->parentnode != 0">
                <li class="navbithome"><a href="index.php{vb:raw session.sessionurl_q}" accesskey="1"><img src="{vb:stylevar imgdir_misc}/navbit-home.png" alt="{vb:rawphrase home}" /></a></li>
                {vb:raw navbits.breadcrumb}
                {vb:raw navbits.lastelement}
                </vb:if>
<vb:else />
                <li class="navbithome"><a href="index.php{vb:raw session.sessionurl_q}" accesskey="1"><img src="{vb:stylevar imgdir_misc}/navbit-home.png" alt="{vb:rawphrase home}" /></a></li>
                {vb:raw navbits.breadcrumb}
                {vb:raw navbits.lastelement}
            </vb:if>



All times are GMT. The time now is 02:29 PM.

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.00980 seconds
  • Memory Usage 1,716KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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