PDA

View Full Version : vBulletin 4 CMS parentnode and node variables


brandondrury
10-27-2012, 07:58 PM
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:

{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:

<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:

<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>