1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Excluding nodes from quick navigation

Discussion in 'Styling and Customization Questions' started by nico_xover, Feb 4, 2016.

  1. nico_xover

    nico_xover Member

    Hi everyone,

    how can I exclude child nodes of a certain forum (that has a massive list of subforums) from the quick navigation?

    I guess I have to work with <xen:if> in this part of the quick_navigation_menu template, but can't get it to work... any tips on which code to include in which row? Very appreciated!!

    Code:
              <xen:foreach loop="$nodes" value="$node">
                 <li class="d{$node.depth} {xen:if "{$selected} == 'node-{$node.node_id}'", 'OverlayScroller'}">
                   <a href="{xen:link {$nodeTypes.{$node.node_type_id}.public_route_prefix}, $node}"
                     class="{xen:if '{$node.node_type_id} == "Category"', 'OverlayCloser'} {xen:if "{$selected} == 'node-{$node.node_id}'", 'selected'}">
                     <span class="_depth{$node.depth} depthPad">{$node.title}</span>
                   </a>
                 </li>
               </xen:foreach>
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Untested.
    Code:
    <xen:foreach loop="$nodes" value="$node">
        <xen:if is="{$node.parent_node_id} != x">
        <li class="d{$node.depth} {xen:if "{$selected} == 'node-{$node.node_id}'", 'OverlayScroller'}">
            <a href="{xen:link {$nodeTypes.{$node.node_type_id}.public_route_prefix}, $node}"
            class="{xen:if '{$node.node_type_id} == "Category"', 'OverlayCloser'} {xen:if "{$selected} == 'node-{$node.node_id}'", 'selected'}">
            <span class="_depth{$node.depth} depthPad">{$node.title}</span>
            </a>
        </li>
        </xen:if>
    </xen:foreach>
    Change the x to the node ID of the parent forum.
     
    wang and nico_xover like this.
  3. nico_xover

    nico_xover Member

    Excellent, thanks!
     

Share This Page