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

how to define extra scripts (js) to include?

Discussion in 'XenForo Questions and Support' started by citricsquid, Aug 30, 2011.

  1. citricsquid

    citricsquid Guest


    I'm using the Google font API (and some JS stuff) and I don't see a place in the style editor to define extra resources to include. The include needs to go in the header, like so:

    <link href='http://fonts.googleapis.com/css?family=IM+Fell+English' rel='stylesheet' type='text/css' />
    What's the proper / officially supported way to do this?
  2. Forsaken

    Forsaken Well-Known Member

    Edit the template.

    EDIT: Sounded kinda basic...

    You can also make styleproperties to control the values (I suggest using the WebFont API that supports various font providers).
  3. Brogan

    Brogan XenForo Moderator Staff Member

    Additional js scripts can be placed in the PAGE_CONTAINER, page_container_js_head or page_container_js_body templates.
  4. ragtek

    ragtek Guest

  5. Andy.N

    Andy.N Well-Known Member

    What are the differences and pro/con of each? When do I put JS in one of those vis-a-vis the others?
  6. Brogan

    Brogan XenForo Moderator Staff Member

    If you use page_container_js_head then it will be included in the head section of PAGE_CONTAINER.

    If you use page_container_js_body then it will be included in the body section of PAGE_CONTAINER, after the footer.

    Using PAGE_CONTAINER you can use your own template or place it elsewhere in the page.

    It depends on the js file to a large extent - some require to be placed in the head, some in the body.
    Andy.N likes this.

Share This Page