Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Load different style sheets for main categories

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #21  
Old 03-25-2014, 04:35 AM
 
kdw kdw is offline
 

Member
  
Join Date: Oct 2011
Posts: 17
 

Default Re: Load different style sheets for main categories

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
Reply With Quote
  #22  
Old 03-25-2014, 09:08 AM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Load different style sheets for main categories

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.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #23  
Old 03-25-2014, 09:17 AM
 
kdw kdw is offline
 

Member
  
Join Date: Oct 2011
Posts: 17
 

Default Re: Load different style sheets for main categories

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
Reply With Quote
  #24  
Old 04-01-2014, 04:53 PM
  cherie's Avatar 
cherie cherie is offline
 

X-Wizard
  
Join Date: May 2003
Location: USA
Posts: 1,534
 

Default Re: Load different style sheets for main categories

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.
__________________
redlimeweb.com
custom mods and design integration
4.7 linux
Reply With Quote
  #25  
Old 04-02-2014, 05:18 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Load different style sheets for main categories

@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.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:38 PM.

   

 
X-Cart forums © 2001-2020