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

XF 1.2 Where is the best place to add a script?

Discussion in 'Styling and Customization Questions' started by Stuart Wright, Oct 8, 2013.

  1. Stuart Wright

    Stuart Wright Well-Known Member

    I want to add this script into Xenforo. Probably near the end.
    It swaps out SVGs with PNGs for browsers which don't support SVGs.
    It uses the Modernizer javascript which I included in the PAGE_CONTAINER template.
    I have popped the above code at the end of page_container_js_body, but I'm expecting there is a better way to do this. Like in a hook or something?
    Thanks
     
  2. Teapot

    Teapot Well-Known Member

    Generally, unless you're planning to put it in its own JavaScript file, the page_container_js_body template is the best place to put it in my opinion.
     
  3. Brogan

    Brogan XenForo Moderator Staff Member

    The FAQ in my signature explains where to add it, depending on the requirements of the script.
     

Share This Page