| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Best way to add additional css file to custom theme | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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. |
|||||||
#2
|
|||||||
|
|||||||
![]() 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:
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.
__________________
=========== x-cart gold/classic 4.6.4 |
|||||||
|
#3
|
|||||||||
|
|||||||||
![]() 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.
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#4
|
|||||||
|
|||||||
![]() Thank you for that clarification. That will be helpful in future.
__________________
=========== x-cart gold/classic 4.6.4 |
|||||||
#5
|
|||||||||
|
|||||||||
![]() 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
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
|||
X-Cart forums © 2001-2020
|