How to insert someting between to categories?

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.
 

Attachments

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.
 

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
 

Jake Bunce

XenForo moderator
Staff 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
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.
 
Top