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

Changing dialog box colours and borders

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-05-2005, 07:57 AM
 
bluebox bluebox is offline
 

Member
  
Join Date: Jan 2003
Posts: 19
 

Default 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??
Reply With Quote
  #2  
Old 04-05-2005, 08:04 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #3  
Old 04-07-2005, 07:28 AM
 
bluebox bluebox is offline
 

Member
  
Join Date: Jan 2003
Posts: 19
 

Default

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,
__________________
------
BlueBox

X-Cart - 4.0.11
Reply With Quote
  #4  
Old 04-07-2005, 04:43 PM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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>
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #5  
Old 04-11-2005, 05:36 AM
 
bluebox bluebox is offline
 

Member
  
Join Date: Jan 2003
Posts: 19
 

Default

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,
__________________
------
BlueBox

X-Cart - 4.0.11
Reply With Quote
  #6  
Old 04-11-2005, 11:35 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #7  
Old 04-12-2005, 12:41 AM
 
bluebox bluebox is offline
 

Member
  
Join Date: Jan 2003
Posts: 19
 

Default

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 :)
__________________
------
BlueBox

X-Cart - 4.0.11
Reply With Quote
  #8  
Old 04-12-2005, 04:39 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

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>
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #9  
Old 04-14-2005, 01:03 AM
 
bluebox bluebox is offline
 

Member
  
Join Date: Jan 2003
Posts: 19
 

Default

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?
__________________
------
BlueBox

X-Cart - 4.0.11
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:11 AM.

   

 
X-Cart forums © 2001-2020