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

Restoring the subheading for subforums

Discussion in 'XenForo Questions and Support' started by yoghurtfarmer, Feb 1, 2011.

  1. yoghurtfarmer

    yoghurtfarmer Well-Known Member

    Like in previous versions as illustrated below:
    subforum.png

    I can get one to appear in RC1 by adding the following to node_forum_level_2:
    <xen:if is="{$level} == 2"><div class="categoryStrip"></div></xen:if>

    but this results in the extra sub-headings on the forum list. Is there a conditional that I can use to make it exclude the forum list nodes? eg: if is = $child..$subforum...$threadlist etc.
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I am not sure I understand exactly what you are doing, but I think you want a condition like this:

    Code:
    <xen:if is="{$level} == 2 AND {$forum.parent_node_id}"><div class="categoryStrip"></div></xen:if>
    
    Or maybe you want the opposite, !{$forum.parent_node_id}:

    Code:
    <xen:if is="{$level} == 2 AND !{$forum.parent_node_id}"><div class="categoryStrip"></div></xen:if>
    
    {$forum.parent_node_id} is false at the top of your node tree, and is true for all node listings below the index page.
     
  3. yoghurtfarmer

    yoghurtfarmer Well-Known Member

    Thanks but it didn't work. Basically I want to restore the categoryStrip bar for sub-forums.

    I'm using the following for now (where 5, 7, 10 and 23) are the nodes that I want a categoryStrip over, but it's not ideal.

    <xen:if is="{$forum.node_id} == 5
    OR {$forum.node_id} == 7
    OR {$forum.node_id} == 10
    OR {$forum.node_id} == 23
    "><div class="categoryStrip"></div></xen:if>
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Can you post a URL to your forum so I can see those nodes in context?
     
  5. yoghurtfarmer

    yoghurtfarmer Well-Known Member

  6. Mike

    Mike XenForo Developer Staff Member

    You're likely to have to deal with a "hacky" version, as the changes that were made do make detecting that situation a little harder. (The changes that were made mean that only one level of sub-forums is shown when viewing a forum.)
     
    yoghurtfarmer likes this.
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Ok I see what you are doing. I don't see anything to distinguish those two forums for use in a conditional.

    One possible solution is to use display orders. If you manage your display orders tightly then the top level forums will always be 1 in which case you can single them out with a condition like this:

    Code:
    <xen:if is="{$level} == 2 AND {$forum.display_order} == 1"><div class="categoryStrip"></div></xen:if>
    
     

Share This Page