| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Load different style sheets for main categories | ||||
![]() |
|
|
Thread Tools | Search this Thread |
#21
|
|||||||
|
|||||||
![]() Hi again
I have {if $topId eq 52} {load_defer file="css/shoes.css" type="css"} {/if} in service_css.tpl and {elseif $topId eq 52} <img src="{$AltImagesDir}/schools/school_shoes.png" alt="" /> in head.tpl Works fine. This changes the styles in the product pages too which is what is needed. Now I need to do the same for a sub category? Have different styles and main logo for different sub cats. I can use if $catid and styles change when I go to that category page BUT when I then click on a product the style reverts to the main category style. Can anyone advise what to use so that the sub cat style is maintained as long as it is when using if $topid ie. through cat pages, product listing pages and product details page. Assuming this is possible of course! Thanks
__________________
tech990 |
|||||||
#22
|
|||||||||
|
|||||||||
![]() Not clear on what you are looking for. Are you no longer wanting to check the top categoryid (topId) or are you ending up on a product page that does not have the correct topId?
If the subcategories and products are under the same topId then they should maintain the style if you are keying off topId. |
|||||||||
#23
|
|||||||
|
|||||||
![]() Thanks for getting back on this.
At the moment I have different logo and style sheet working based on $topid. Works fine and the chosen image and stylesheet stays in place through category and product pages. However I would like to be able to have a different image and style sheet based on the sub category, overriding the top level once in the sub category and it's product pages. Is there a $subcatid or something I can use like I am using $topid? Here is the site http://www.graypalmer.co.uk/store/ EG. Default styles show when entering shop. Clicking a main category changes img and stylesheet and this persists through sub cats to product details etc. On some sub cats however I now want to also override the main img and styles. Hope that clarifies? Many thanks. Keith
__________________
tech990 |
|||||||
#24
|
|||||||||
|
|||||||||
![]() Wouldn't post 17 do the trick?
If you are looking for $catid you could see if $current_category or $product.categoryid will do the trick. Check the Smarty variables for the page you are on to see if something looks like it might work. |
|||||||||
#25
|
|||||||||
|
|||||||||
![]() @tech990
Dude, have you been working on this for 2 years? ![]()
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey XcartGuru X-cart Tutorials | X-cart 5 Tutorials Check out the responsive template for X-cart. |
|||||||||
|
|||
X-Cart forums © 2001-2020
|