XF 1.3 Hiding "Post New thread" button for selected forums

0ptima

Well-known member
#3
You can also do it with a template conditional.

Edit the forum_view template

find
Code:
<a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a>
replace the above
Code:
<xen:if is="!in_array({$forum.node_id}, array(5,7,16))">
<a href="{xen:link 'forums/create-thread', $forum}" class="callToAction"><span>{xen:phrase post_new_thread}</span></a>
</xen:if>

Change the node IDs to the forums you do not want to see the button
Code:
array(5,7,16)
 

Brogan

XenForo moderator
Staff member
#5
Surely that is desirable?
Otherwise members are going to wonder why the post new thread button doesn't appear.

If I visited a site which hid the button using a conditional statement, I would report it as a bug.
 
#6
Surely that is desirable?
Otherwise members are going to wonder why the post new thread button doesn't appear.

If I visited a site which hid the button using a conditional statement, I would report it as a bug.
i created several forms that which has that forum as a destination, and added my own buttons to the forms on that forum.

i prefer users to use the forms instead of the default new thread template.
 
Top