X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Changing colours in categories.tpl (https://forum.x-cart.com/showthread.php?t=5997)

daveb1 01-12-2004 05:22 PM

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

funkydunk 01-13-2004 11:11 PM

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

daveb1 01-13-2004 11:52 PM

Thanks Funkydunk :D

I'll give it a go later tonight

Cheers

Dave

daveb1 01-15-2004 09:33 AM

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

funkydunk 01-15-2004 10:42 AM

Sorry - I corrected my post because of that problem.

daveb1 01-15-2004 11:54 AM

Perfect! :D :D

Thanks

Dave

dealsondeals 01-15-2004 12:15 PM

:D 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


All times are GMT -8. The time now is 01:36 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.