• 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?


Active member

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“... />

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


Active member
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

it won't work. Any ideas?


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