Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / sidebox/header link color

sidebox/header link color

Views: 2,261

Results 1 to 12 of 12
30 Mar 2011, 4:01 AM
#1
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

sidebox/header link color

Hello,

I've been trying to change the color of one link in my sidebox and in my header. I can't seem to locate them in my stylesheet, and have no idea how to go about changing the color of one specific link. If anyone has any advice or suggestions it would be greatly appreciated. I'm using the latest version, and my site is:

http://www.kamskungfucinema.com/zencart/

...with the link "NEW & RARE" needing its color changed

30 Mar 2011, 9:41 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: sidebox/header link color

You can't, really, with the standard Zencart categories box. There's a mod in the Free Software Add Ons which converts the Categories box to an unordered list. You might be able to specify a class name for that list item and style it in the stylesheet.

30 Mar 2011, 4:14 PM
#3
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

Re: sidebox/header link color

OK, thanks, I'll give that a try. Any idea what this mod is called?

30 Mar 2011, 5:15 PM
#5
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

Re: sidebox/header link color

I found this in an older post:

tpl_categories.php has a commented section describing how to make individual categories have their own styling. You can do this for each category by adding a case section in tpl_categories.php and a rule in the stylesheet for each class you so define.

Say you call one category "category-holiday" as described, you would then add to your stylesheet

a.category-holiday {color: #aabbcc;}

Adjust the color as desired.

Can it be done this way?

30 Mar 2011, 5:16 PM
#6
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

Re: sidebox/header link color

Though I'm still unsure of what they mean by adding a "case" and "rule", just like I'm not sure what you mean by "specify a class name for that list item"

30 Mar 2011, 6:31 PM
#7
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: sidebox/header link color

I hadn't seen that. Just uncomment these lines from the original tpl_categories.php file:

// case ($box_categories_array[$i]['path'] == 'cPath=3'):
// $new_style = 'category-holiday';
// break;

by removing the // before each one, change the '3' to the id number of the category you want to style, then save the file to your custom template's sideboxes folder.

Then add this to the stylesheet and style it the way you want - this will make the link red:

A.category-holiday {color:#ff0000;}

31 Mar 2011, 2:14 AM
#8
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

Re: sidebox/header link color

Hmm....no color change, it just made it so my site wont scroll down. Did I edit the code correctly?

$content .= '<div id="' . str_replace('_', '-', $box_id . 'Content') . '" class="sideBoxContent">' . "\n";
for ($i=0;$i<sizeof($box_categories_array);$i++) {
switch(true) {
// to make a specific category stand out define a new class in the stylesheet example: A.category-holiday
// uncomment the select below and set the cPath=3 to the cPath= your_categories_id
// many variations of this can be done
case ($box_categories_array[$i]['path'] == 'cPath=10'):
$new_style = 'category-holiday';
break;

31 Mar 2011, 2:32 AM
#9
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

Re: sidebox/header link color

Oh...nevermind my site will scroll.

Just no color change

31 Mar 2011, 3:08 AM
#10
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

Re: sidebox/header link color

Or does it matter where I add it in my style sheet?

31 Mar 2011, 6:19 AM
#11
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

Re: sidebox/header link color

hmmm.. still no color change, I wonder what went wrong :wacko:

31 Mar 2011, 6:27 AM
#12
jenesaisquoi avatar

jenesaisquoi

New Zenner

Join Date:
Mar 2011
Posts:
65
Plugin Contributions:
0

Re: sidebox/header link color

Ok, I finally got it. The color has changed, I added it lower in my stylesheet near under the sidebox desctriptions and it worked there. :D

thanks stevesh, you've been a big help