I would like to know whether it is possible to load a particular javascript only on some specific pages.
for example, for a page named “gallery” associated with “gallery template” or “gallery snippet”, is it possible to add only for this template/snippet a javascript (for example gallery.js). Since this script is not supposed to be used for others templates/pages I don’t need to load it for others pages/templates.
In addition, is it possible for example to have a <div> to be displayed/visible depending on which the page/template is called.
To make it short, how to implement an option to have a specific header for the home page and an other header for all other pages.
Thank you in advance
I was asking out of curiosity because I admit not using it myself! The reason is different though: I don’t like calling several css files and don’t usually have enough differences in css per page to justify in my opinion another file!
But this gave me a great tutorial idea to merge and mininify assets with template specific files too! Mmh gotta try this!
Don’t know if I understand you correctly, but it would make more sense to load an additional file rather than load the complete merged CSS file. The browser should actually cache your main CSS file and not reload it on the next page. This advantage would be counteracted by loading a completely new asset.
If you have several CSS files that should be loaded on every page, they should be merged anyway.