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

Changing colours in categories.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-12-2004, 05:22 PM
 
daveb1 daveb1 is offline
 

eXpert
  
Join Date: Sep 2003
Location: Brighton, UK
Posts: 222
 

Default Changing colours in categories.tpl

Hi all,

My client wants each category name to have a different colour, as her logo is also multicoloured.

I've traced the file that generates the list to categories.tpl, but simply taking out the font/class statements doesn't work as the list is generated on the fly rather than being html.

I know I can change this easily in the static html pages, but can anyone come up with a way to make each category heading in the category list have a different colour in the dynamic pages?

Cheers

Dave
__________________
Quiet please... I'm trying to unscramble my brian.

http://lizzybug.co.uk (live, minor mods, 4.0.15)
EZCheckout/EZUpsell (Must have mods!) Firetank's Featured Products Manager, and loads of little mods off the forum (thanks all!)

http://www.jellybeangifts.co.uk (live, 4.0.18 ) Fancy Cats + custom colour mod
Reply With Quote
  #2  
Old 01-13-2004, 11:11 PM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

This could be done as follows:

code for categories.tpl:

Code:
{* $Id: categories.tpl,v 1.19 2003/11/11 14:02:32 svowl Exp $ *} {capture name=menu} {if $active_modules.Fancy_Categories ne ""} {include file="`$fancycategories_config.modules_path`/fancy_categories.tpl"} {else} {if $config.General.root_categories eq "Y"} {section name=cat_num loop=$categories} <font class=CategoriesList{ $categories[cat_num].categoryid }>{ $categories[cat_num].category_name|escape }</font> {/section} {else} {section name=cat_num loop=$subcategories} <font class=CategoriesList{ $categories[cat_num].categoryid }>{ $subcategories[cat_num].category_name|escape }</font> {/section} {/if} {/if} {/capture} { include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu }

This will then say for each category item it will look for a style in the style sheet of CategoriesList123 or whatever the category id is.

Then simply create a style sheet class for each category id as follows:

.CategoriesList1{
FONT-SIZE: 12px;
COLOR: #330000;
}
.CategoriesList2{
FONT-SIZE: 12px;
COLOR: #FF9900;
}
.CategoriesList3{
FONT-SIZE: 12px;
COLOR: #FF3300;
}

etc etc etc .............

hth
__________________
ex x-cart guru
Reply With Quote
  #3  
Old 01-13-2004, 11:52 PM
 
daveb1 daveb1 is offline
 

eXpert
  
Join Date: Sep 2003
Location: Brighton, UK
Posts: 222
 

Default

Thanks Funkydunk

I'll give it a go later tonight

Cheers

Dave
__________________
Quiet please... I'm trying to unscramble my brian.

http://lizzybug.co.uk (live, minor mods, 4.0.15)
EZCheckout/EZUpsell (Must have mods!) Firetank's Featured Products Manager, and loads of little mods off the forum (thanks all!)

http://www.jellybeangifts.co.uk (live, 4.0.18 ) Fancy Cats + custom colour mod
Reply With Quote
  #4  
Old 01-15-2004, 09:33 AM
 
daveb1 daveb1 is offline
 

eXpert
  
Join Date: Sep 2003
Location: Brighton, UK
Posts: 222
 

Default

Hi Funkydunk

I've done the mods as you suggested, but it doesn't show the colours. I know it is picking up the right details, because if I change the font-size on one of the categories for example it shows the changes.

This is copied from the page source code

Quote:

<font class=CategoriesList>Little Bundles</font>



<font class=CategoriesList>Special Bundles</font>



<font class=CategoriesList>Blankets</font>



<font class=CategoriesList>Little Treasures</font>



<font class=CategoriesList>Photo Albums</font>



<font class=CategoriesList>Aromatherapy Gifts</font>



<font class=CategoriesList>Handmade Shoes</font>




It seems that the link elements in the CSS file are overring the colours, but I've no idea how to stop this happening.

Do you have any further ideas?

Cheers

Dave
__________________
Quiet please... I'm trying to unscramble my brian.

http://lizzybug.co.uk (live, minor mods, 4.0.15)
EZCheckout/EZUpsell (Must have mods!) Firetank's Featured Products Manager, and loads of little mods off the forum (thanks all!)

http://www.jellybeangifts.co.uk (live, 4.0.18 ) Fancy Cats + custom colour mod
Reply With Quote
  #5  
Old 01-15-2004, 10:42 AM
 
funkydunk funkydunk is offline
 

X-Man
  
Join Date: Oct 2002
Location: Cambridge, UK
Posts: 2,210
 

Default

Sorry - I corrected my post because of that problem.
__________________
ex x-cart guru
Reply With Quote
  #6  
Old 01-15-2004, 11:54 AM
 
daveb1 daveb1 is offline
 

eXpert
  
Join Date: Sep 2003
Location: Brighton, UK
Posts: 222
 

Default

Perfect!

Thanks

Dave
__________________
Quiet please... I'm trying to unscramble my brian.

http://lizzybug.co.uk (live, minor mods, 4.0.15)
EZCheckout/EZUpsell (Must have mods!) Firetank's Featured Products Manager, and loads of little mods off the forum (thanks all!)

http://www.jellybeangifts.co.uk (live, 4.0.18 ) Fancy Cats + custom colour mod
Reply With Quote
  #7  
Old 01-15-2004, 12:15 PM
 
dealsondeals dealsondeals is offline
 

eXpert
  
Join Date: Dec 2002
Location: Dallas, Texas, USA
Posts: 231
 

Default

Nice one FunkyDunk!

If possible please move to the "Custom Mods" area of the forum. That way it'll be an easy find in the future.

Thanks,

Glen
__________________
Never understimate stupidity.
--------
X-Cart Version: 3.5.2
Hosting:mind-in-design.net
Configuration: Virtual Dedicated Server || Intel Pentium 4 2.4 GHZ CPU || 1024MB PC2100 DDR RAM || Linux || PHP 4.3.2 || MySQL server 4.0.14
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 04:29 AM.

   

 
X-Cart forums © 2001-2020