where to put extra CSS/Javascript files and how to load them

Permalink 1 user found helpful

I want to use a particular CSS file (which must go in the head) and I have a javascript file.

These files are only applicable to one small part of one page and don't wish to start modifying the theme I have bought from the marketplace.

I can create the HTML I need by adding an HTML content block, but how can I specify that I want an external CSS file loaded in.

which directory do I upload or FTP it?
how do I specify it's inclusion in the content?

Thank you..


View Replies: View Best Answer
ScottSandbakken replied on at Permalink Best Answer Reply
In the page properties, you can use the "Header Extra Content". Just upload the JS and CSS files to the [root]/js and [root]/css respectively and add your complete script and link tags to the "Header Extra Content" page property.

<link href="/css/styles.css" rel="stylesheet" type="text/css" />
<script type='text/javascript' src='/js/scripts.js'></script>
95point2 replied on at Permalink Reply
Thanks NetJunky279,

This works great.

I was worried that putting extra files in the concrete5 installation might be trouble when it comes to upgrading so I made a folder specifically for my own extra files (jquery plugins, small scripts etc) in /resources which I can track separately in a VCS.

I added the extra headers as you suggest and it works fine.

The one problem I have is that my site is installed underneath /site (so /site/resources must be hardcoded into such inclusions to make it work)

Is there a way to ask C5 at runtime for the install path - (just incase the client wants to change it!)


cjramki replied on at Permalink Reply
Thanks NetJunky279 !!!,

This is what i need...