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

template parameter for a CATEGORY

Weppa333

Active member
#1
Hello

This is my first message in XF1.2 :)

I would like to find a way to create a conditional, in a template, to know whether or not I'm in a CATEGORY, and the category name/ID

I found template parmas [forum][node_id] but it seems it is NOT filled up when inside a category.

I cannot find the right template parameter for a category. can anyone help ?
 

Weppa333

Active member
#6
I'll try, It's not really in a page per-se, it's as a conditionnal for widgetframework that I'm trying to use it.
I basically want the widget to activate only when in a specific category
 

Weppa333

Active member
#7
I can assure you that
<xen:if is="{$category.node_id} == 1">
This content will show in category 1
</xen:if>

never show on category 1, with category as pages activated.

Same with xen:container using another variable,
 

Brogan

XenForo moderator
Staff member
#8
I can assure you it does, I have just tested it on my local to confirm.
I edited the category view template and added that very code.

category_view.PNG

It shows in category 1 only and nowhere else.