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

XF 1.3 Include JavaScript in template ?

Discussion in 'XenForo Questions and Support' started by LordsKing, May 5, 2014.

  1. LordsKing

    LordsKing Active Member

    Hi :D
    Is it possible to do a template named like this : xxxxxxxx.js ?
    And if possible how ca I insert the template in an other template ?
    Maybe : <xen:include js="xxxxxxxx.js" /> ?
  2. Brogan

    Brogan XenForo Moderator Staff Member

    From the FAQ:

    Where can additional JavaScript be placed?
    Additional JavaScript can be placed in the PAGE_CONTAINER, page_container_js_head or page_container_js_body templates. If PAGE_CONTAINER is used, it can be placed anywhere in the template. If page_container_js_head is used, it will be included in the head section of PAGE_CONTAINER. If page_container_js_body is used, it will be included in the body section of PAGE_CONTAINER, after the footer. It depends on the JavaScript to a large extent; some require to be placed in the head, some in the body.

    How do I include a JavaScript file?
    <xen:require js="name_of_javascript_file.js" />
    bloop, Brad L and Technique1009 like this.
  3. LordsKing

    LordsKing Active Member

    Thanks you very much :D

Share This Page