Hi there,
I was wondering, what would be the best way to add additional css and js files to Pavillion in order to get minified and compressed?
In my old theme, I was using a custom script to add them to the header style and script foreach loop. So they customly loaded when needed on the specific site.
Best,
Axanne
|
|
Hello Axanne,
You can use Pavilion CP > Theme Settings > Custom > Stylesheet/Javascript fields. All data stored there is combined and minified along with the other theme css and js.
BR,
ThemeBurn team
|
|
Thanks for the reply. But can I just paste the url to the script/css and it will be added?
Another problem is, that if I add it there, it will be loaded on each page and not necessarily only on the page it’s needed (like only product page), hence increasing load time.
Does your theme compress and minifies all scripts, which are loaded by default opencart (via the foreach loops in the header tpl)? If so, then I would just add the scripts i need there and it will be loaded, if needed for that page.
|
|
Hi,
1) You will have to put CSS contents and not url
2) Unfortunately, styles and scripts added from the admin panel are always loaded.
3) For the moment Pavilion does not compress any additional styles and scripts. However we can add this feature in future updates
BR,
ThemeBurn team
|
|
Thanks for your reply! Indeed, I think adding compression to any additional styles & JS would be a nice think.
Could you quickly elaborate the difference between page.css.tpl and main.css.tpl? I already read the information here.
There are two sections in these css: C U S T O M S T Y L E S and EXTERNAL .
Custom styles are the css from the configuration panel, I guess. But what kind of CSS are added in External?
|
|
Hi,
External are styles of libraries that Pavilion merges with the main stylesheet. E.g. the Fotorama gallery on the product page and the Swiper slider.
Custom styles (page.css) are those styles that are generated by Page Builder and are unique for each page.
BR,
ThemeBurn team
|
|