| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
How to add CSS for custom module. | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() Hello,
I have created custom module in XCart5. I have also added module setting code for adding HTML. So Is there any way to include css and js withing module directory. I have tried this reference way: https://devs.x-cart.com/design_changes/adding_css_and_js_files.html But my custom module stopped working after adding this reference code. So can you please suggest how can I add CSS for particular module within module files. Thanks,
__________________
X-Cart version 5.3.6.3 |
|||||||
#2
|
|||||||
|
|||||||
![]() I have recently used the method you refer to and it works (on X-cart version is 5.4.0.5, but the documentation is for older versions, so it should also work for 5.3.6.3) , so probably you have spelling problem or something.
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
#3
|
|||||||
|
|||||||
![]() Hi,
Thanks for your reply. Actually now, my css and js are included on website but css is not applied on DOM element(like div). Can you please suggest on what I am doing wrong. Thanks,
__________________
X-Cart version 5.3.6.3 |
|||||||
#4
|
|||||||
|
|||||||
![]() Is it the CSS rules that aren't applied, or JS not making necessary changes on dom elements so that the css apply?
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
#5
|
|||||||
|
|||||||
![]() Hi,
Actually CSS rules are aren't applied on DOM Element. JS is working fine. I have debug the code and got that if I use list=body than CSS is included but not applied and if I use list=layout.main than it start working. I didn't understand why this happens. Can you please suggest why my CSS not applied with list=body. Thanks,
__________________
X-Cart version 5.3.6.3 |
|||||||
#6
|
|||||||
|
|||||||
![]() Presumably it is because there are rules from XC or other modules that apply to list=layout.main and they have priorities as layout.main is more specific than body.
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
#7
|
|||||||
|
|||||||
![]() Ok thanks, means we are not able to apply css if we use list=body.
There is no way to apply css on element if we use list=body in module.
__________________
X-Cart version 5.3.6.3 |
|||||||
#8
|
|||||||
|
|||||||
![]() From /skins/customer/body.twig
Code:
__________________
X-cart 5.2.12, php 5.6 Ed from Grenoble, France |
|||||||
|
|||
X-Cart forums © 2001-2020
|