Best way to add additional css file to custom theme
Looking for the most efficient way to add a css file to a custom theme and have it load LAST in X-Cart 5.x
I realize I could hard code a link to it into a .tpl file, but there's probably a better way to handle it to take advantage of aggregating/minifying that X-Cart 5 does. |
Re: Best way to add additional css file to custom theme
For 5.1.7:
Figured it out. Follow instructions in KB here: http://kb.x-cart.com/display/XDD/Step+2+-+applying+design+changes except with the following changes if your custom theme is a module. In your module directory (classes/XLite/YourName/YourThemeName/View/) create AView.php with the following code Code:
<?php And then make sure yourcssfile.css is in /skins/YourThemeName/default/en/css/ Probably pretty basic and unnecessary, but just in case others are less experienced with XCart 5 like me and need it really spelled out. |
Re: Best way to add additional css file to custom theme
This is how you do it but keep in mind this will not make the file to load last. So you should use classes names as unique as possible.
If "YourName" from above is "spdesign" and you have another module with "YourName" being "thespdesign" loading another css file their css file will load after yours. |
Re: Best way to add additional css file to custom theme
Thank you for that clarification. That will be helpful in future.
|
Re: Best way to add additional css file to custom theme
I would not rely on module's name in order to be last. If you want to be after certain CSS file, then use sorting option or depend on the module:
http://kb.x-cart.com/display/XDD/Making+one+module+depend+on+another |
All times are GMT -8. The time now is 02:49 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.