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

XF 1.2 Best place to insert embeddable codes?

Discussion in 'XenForo Questions and Support' started by Jeffin, Jul 30, 2013.

  1. Jeffin

    Jeffin Well-Known Member

    Where's the best place to insert embeddable codes? Is the footer template the best place or is it somewhere else? I want to embed a few codes in such a way I don't have to reinsert the code every time the forum is upgraded. Some advice please. :rolleyes:
  2. JulianD

    JulianD Well-Known Member

    If you're talking about some sort of Javascript code, the templates page_container_js_body and page_container_js_head are nice places to put your javascript. Some optimization sites even suggest to put your javascript code at the end of the page. If you'd want to follow that suggestion, page_container_js_body is the best place then.

    Also, don't be worry about modifying the templates. Take a look at this guide:

    Jeffin likes this.
  3. 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.

    Jeffin and Etchel like this.

Share This Page