X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Changing dialog box colours and borders (https://forum.x-cart.com/showthread.php?t=13228)

bluebox 04-05-2005 07:57 AM

Changing dialog box colours and borders
 
I am in the middle of changing the backgrounds and templates of our X Cart site with various Mods that I have found on here. We have changed the categories so that each category name is a different colour (as per our 6 different coloured product ranges). Looks like this at the moment www.kitinfo.co.uk/kitwarehouse/home.php (still needs some tweaking).
I used a MOD which looked a little like this:

Code:

{if $config.General.root_categories eq "Y"}
{section name=cat_num loop=$categories}
<FONT class="CategoriesList">{$categories[cat_num].category}</FONT>

{/section}
{else}


What Im now wanting to do is have the backgrounds of the dialog boxes and borders change colour as per the product ranges?? I know that what needs doing is within the dialog.tpl and that it will entail an {if} function and setting up 6 different dialogborder styles in css but so far Ive been unable to figure it out???

Anyone able to help??

shan 04-05-2005 08:04 AM

your better to create new style sheets and then use the if statement in home.tpl to swap between them depending on the value of $cat

bluebox 04-07-2005 07:28 AM

Thanks for that info but could you be a little more specific! I know that the dialogbox and the dialogborder have styles set up in the skin.css and thought that I was right in setting up a style for each of the colours that I need but its the coding that IБ─≥m struggling with. I thought that the IF statement might go in the dialog.tpl or products.tpl

Do you have an example of where the coding would go in home.tpl?

Many thanks,

shan 04-07-2005 04:43 PM

something like this

Code:

{ include file="meta.tpl" }
{if $cat eq 1}
<LINK rel="stylesheet" href="{$SkinDir}/skin1.css">
{elseif $cat eq 2}
<LINK rel="stylesheet" href="{$SkinDir}/skin2.css">
{elseif $cat eq 3}
<LINK rel="stylesheet" href="{$SkinDir}/skin3.css">
{elseif $cat eq 4}
<LINK rel="stylesheet" href="{$SkinDir}/skin4.css">
{else}
<LINK rel="stylesheet" href="{$SkinDir}/skin1.css">
{/if}
</HEAD>


bluebox 04-11-2005 05:36 AM

Thanks for that, did what you suggested and it worked great! until I looked further? If you select the categories then the background colours change just like what I wanted and that works fine if I had products directly in the categories but I have subcategories and then when you select the subcategories (jackets for example) then it goes to the default because jackets has a different cat id?? Obviously I cant go thru adding a different cat id to the home.tpl file? Is there anyway of stating that whatever subcat of cat1 for example use skin1 and whatever subcat of cat2 use skin2 and so on??

Many thanks for your help so far Shan,

shan 04-11-2005 11:35 AM

you could use this variable instead of {$cat}

{$location[1].1|replace:"home.php?cat=":""}

this is basicaly the bit that creates the location link

so something like

{if $location[1].1|replace:"home.php?cat=":"" eq 1}

etc

bluebox 04-12-2005 12:41 AM

Cheers Shan,

But would it be possible for you to expand on it a bit more, with a bit of an example, as you did before!

Many thanks for your help,

Cheers :)

shan 04-12-2005 04:39 AM

Code:

{ include file="meta.tpl" }
{if $location[1].1|replace:"home.php?cat=":"" eq 1}
<LINK rel="stylesheet" href="{$SkinDir}/skin1.css">
{elseif $location[1].1|replace:"home.php?cat=":"" eq  2}
<LINK rel="stylesheet" href="{$SkinDir}/skin2.css">
{elseif $location[1].1|replace:"home.php?cat=":"" eq  3}
<LINK rel="stylesheet" href="{$SkinDir}/skin3.css">
{elseif $location[1].1|replace:"home.php?cat=":"" eq 4}
<LINK rel="stylesheet" href="{$SkinDir}/skin4.css">
{else}
<LINK rel="stylesheet" href="{$SkinDir}/skin1.css">
{/if}
</HEAD>


bluebox 04-14-2005 01:03 AM

Cheers, Shan.

That does the trick!

But, If you look at the page in IE it all works all ok but if you look at it in mozilla, netscape, firefox, or safari then the coloured category boxes donБ─≥t work properly?! it worked originally because I made 6 different coloured catlist styles in css and put a width and height setting within the style, that seemed to work fine in IE but it doesnБ─≥t work at all in anything else???

Any ideas on this?


All times are GMT -8. The time now is 10:53 PM.

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