how to define extra scripts (js) to include?

C

citricsquid

Guest
Ahoy!

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:

Code:
<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?
 

Forsaken

Well-known member
Ahoy!

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:

Code:
<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?
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).
 

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.
 

Andy.N

Well-known member
Additional js scripts can be placed in the PAGE_CONTAINER, page_container_js_head or page_container_js_body templates.
What are the differences and pro/con of each? When do I put JS in one of those vis-a-vis the others?
 

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