No announcement yet.

Help getting a conditional using the nodeid in navbar template

  • Filter
  • Time
  • Show
Clear All
new posts

  • Help getting a conditional using the nodeid in navbar template

    I am still trying to mash my limited programming skills in with what I am learning in vb4. The current task is to try and reproduce something from my 3.8 template. I used to have a little graphic in the header area in my vb3.8 that would show a different graphic depending on if the a specific forum was being browsed, if in the vb blogs area, groups, etc. I am now trying to bring this design element over to my vb4 test install. I have it working (more or less) in the forums using the following:
    <vb:if condition="THIS_SCRIPT == 'forumdisplay' || THIS_SCRIPT == 'showthread' || VB_ENTRY == 'forum.php'">
    	<vb:if condition="$foruminfo['forumid'] == 4">
    		<img src="/images/image1.gif"  />
    	<vb:elseif condition="$foruminfo['forumid'] == 5" />
    		<img src="/images/image2.gif" />
    	<vb:else />
    		<img src="/images/defaultimage.gif" />
    Now I am trying to bring this over to the CMS. I know to look for the nodeid but the problem is my conditionals are in the navbar template and nodeid does now pass through to that template.

    I have been reading like a crazy person to try to find something that works. I am thinking I need a plug-in that takes the nodeid variable and passes it into the navbar template for use in the conditional. My problem now is I have read so much that I am completely confused by how this can be done.

    Any help available or tips to get me in the right direction here?

  • #2
    Not sure if I am on the right track here... I would appreciate a course correction or a "give up it isn't possible this way"

    This plug-in code is NOT working...
    Product: vB CMS
    Hook: process_templates_complete
    $mynodeid = $node['nodeid'];
    vB_Template::preRegister('navbar',array('mynodeid' => $mynodeid));


    • #3
      We don't provide custom coding, or modification support here. Please see for more help.


      • #4
        Just to add:

        Found that just now


        • #5
          Excellent timing! Thanks Zachary!


          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.