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

XF 1.3 How can I create a hook for all forums of a single category?

rhodes

Active member
#1
Hello,

I use his code to show some widgets only in the sidebar of a single forum. In this example it is the forum with id=7.

<xen:if is="{$forum.node_id} == 7">
<xen:hook name=„myhook“... />
</xen:if>

My forum structure is like this

Category 5
forum 6
forum 7
forum 8


Now I would like to create „myhook“ in all forums of category 5. Is it possible without repeating the code from above for every forum ID?

regards, rhodes
 

rhodes

Active member
#4
May I ask one last question?

When I try to create the hook for a category page like this

<xen:if is="{$category.node_id} == 16">
This content will show in sidebar of category id 16
</xen:if>


it won't work. Any ideas?
 

Brogan

XenForo moderator
Staff member
#5
That will only work if you have categories set as pages in the ACP -> Options -> Node & Forum List: Create Pages for Categories.