• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Show message when creating thread in a specific forum.

Vincent

Well-known member
I made a little modification here so that, when creating a thread in a specific forum, a message comes up. This can be useful for if you got special rules for those forums, it will look like this than:

create_thread.webp


Go to the template called 'thread_create'

Now find
Code:
<xen:include template="helper_captcha_unit" />

And add after:
Code:
<xen:if is="{$forum.node_id} == FORUM_ID OR {$forum.node_id} == OTHER_FORUM_ID">
    <p class="importantMessage">
        <a href="/pages/YOURPAGE">
        Please read the forum rules before creating a post.<br />
        If you don't follow them, your thread will get locked.</a>
    </p>
</xen:if>

Note that the 'OR {$forum.node_id} == OTHER_FORUM_ID' isn't necessary if you only want it in 1 forum to appear.
 
The following templates contained errors and were not saved: thread_create: 1) Line 29: Invalid

This error message appear when i click Save template. My xenForo is 1.0.3, please see it and help :)
 
Did you replace FORUM_ID and OTHER_FORUM_ID with the actual IDs of the forums?

You also need to replace a href="/pages/YOURPAGE" with the actual URL.
 
You could use template hook thread_create_fields_main for this, then it wouldn't be necessary to edit the template;)

(ok it would be under the title and not above, but i would use the add-on and wouldn't need to code it myself^^)
 
Top Bottom