1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum is for release discussion only. Discussions that do not relate specifically to the resource release should be discussed in another, more appropriate forum.
    Dismiss Notice
  3. 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.

Discussion in 'Template Modifications [Archive]' started by Vincent, Oct 16, 2010.

  1. Vincent

    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.png


    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.
     
    Sylar, Brett Peters, Lu Kas and 6 others like this.
  2. Shelley

    Shelley Well-Known Member

    Very nice and useful. Thanks for posting. :)
     
    Vincent likes this.
  3. Vincent

    Vincent Well-Known Member

    Just like your smileys ;) No problem:D
     
  4. borbole

    borbole Well-Known Member

    This is a very nice option. I will be using it for sure. Good work :)
     
  5. Crazyfruitbat

    Crazyfruitbat Well-Known Member

    Nice! I will certainly add this!
     
  6. Vincent

    Vincent Well-Known Member

    Thanks (y)
     
  7. Gultog

    Gultog Member

    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 :)
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
    Gultog likes this.
  9. Gultog

    Gultog Member

    OMG I see, thanks much :)
     
  10. ragtek

    ragtek Guest

    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^^)
     
  11. Kier

    Kier XenForo Developer Staff Member

    FWIW, this is easily possible in the 1.1 notices system.
     

Share This Page