where to put extra CSS/Javascript files and how to load them
Permalink 1 user found helpful
Hi,
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..
Rob
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..
Rob
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.
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!)
Thanks
Rob
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!)
Thanks
Rob
Thanks NetJunky279 !!!,
This is what i need...
This is what i need...