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

How to insert someting between to categories?

Discussion in 'XenForo Questions and Support' started by Richey, Apr 7, 2011.

  1. Richey

    Richey Member

    Hey guys,

    let's say i want to insert an ad or an image bewteen to forum categories.
    What's the right template and the condition code to do this?

    Best regards.
     

    Attached Files:

  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Edit this template:

    Admin CP -> Appearance -> Templates -> node_category_level_1

    Add this code to the top of the template:

    Code:
    <xen:if is="{$category.node_id} == X">
    	<div style="text-align: center; margin-bottom: 20px;">
    		BANNER HERE
    	</div>
    </xen:if>
    
    Replace X with the node_id of the category directly below the banner.
     
    Deebs, Renada, Jo. and 3 others like this.
  3. Richey

    Richey Member

    Fantastic! Thanks a lot Jake.
     
  4. qak01ok

    qak01ok New Member

    Is there a way to insert a ad or banner between each category? The aboved works GREAT on the first category but I have multipule categorys and would like to intsert different banner and ads between different categories
     
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Use this:

    Code:
    <xen:if is="in_array({$category.node_id}, array(X,Y,Z))">
    <div style="text-align: center; margin-bottom: 20px;">
    	<xen:if is="{$category.node_id} == X">
    		BANNER X
    	</xen:if>
    	<xen:if is="{$category.node_id} == Y">
    		BANNER Y
    	</xen:if>
    	<xen:if is="{$category.node_id} == Z">
    		BANNER Z
    	</xen:if>
    </div>
    </xen:if>
    
    You need to specify node_id X, Y, and Z in the conditions appropriately.
     
    bogus and Richey like this.

Share This Page