Color Single Category Text
11 posts
• Page 1 of 1
Color Single Category Text
Does anyone know how I can get a specific category to be styled? For instance, I have a CLEARANCE category that I would like in bold red. I don't see how I can add a style to that category.
Last edited by i2Paq on Fri Aug 20, 2010 8:21 am, edited 1 time in total.
Reason: Topic moved
Reason: Topic moved
- smorelli
- Posts: 93
- Joined: Tue Jan 26, 2010 10:28 pm
Re: Color Single Category Text
Open
find
around line 50 and change it to
then for say category 20, in your stylesheet use the selector
- Code: Select all
/catalog/controller/module/category.php
find
- Code: Select all
$output .= '<li>';
around line 50 and change it to
- Code: Select all
$output .= '<li id="category-'.$result['category_id'].'">';
then for say category 20, in your stylesheet use the selector
- Code: Select all
#category-20 {
/* STYLE INFO HERE */
}

Better Product SEO URL's - Perfectly structured product links
Better Category SEO URL's - Give subcategories the same SEO keyword
SEO URL's Route Editor - Fix all of your index.php links

-

JAY6390 - Posts: 4636
- Joined: Wed May 26, 2010 3:47 pm
- Location: United Kingdom
Re: Color Single Category Text
is there a way where only the main category will be styled and not the sub-categories under it?
thanks!
thanks!
-

dramony - Posts: 258
- Joined: Sat Oct 24, 2009 4:34 am
Re: Color Single Category Text
Just use a child selector via css
http://www.w3.org/TR/CSS2/selector.html#child-selectors
for example, in the default theme, use
which will only style the first level category list items, not their descendants.
http://www.w3.org/TR/CSS2/selector.html#child-selectors
for example, in the default theme, use
- Code: Select all
#category > ul > li
which will only style the first level category list items, not their descendants.

Better Product SEO URL's - Perfectly structured product links
Better Category SEO URL's - Give subcategories the same SEO keyword
SEO URL's Route Editor - Fix all of your index.php links

-

JAY6390 - Posts: 4636
- Joined: Wed May 26, 2010 3:47 pm
- Location: United Kingdom
Re: Color Single Category Text
not working on my end..
-

dramony - Posts: 258
- Joined: Sat Oct 24, 2009 4:34 am
Re: Color Single Category Text
Not sure then with your stuff, but for example, on the category you can use
and get this result
http://screenshots.jaygilford.com/2010-08-24_1425.png
If you want to edit the link tags, you need to use
- Code: Select all
#category > ul > li {
border: 1px solid black;
}
and get this result
http://screenshots.jaygilford.com/2010-08-24_1425.png
If you want to edit the link tags, you need to use
- Code: Select all
#category > ul > li > a

Better Product SEO URL's - Perfectly structured product links
Better Category SEO URL's - Give subcategories the same SEO keyword
SEO URL's Route Editor - Fix all of your index.php links

-

JAY6390 - Posts: 4636
- Joined: Wed May 26, 2010 3:47 pm
- Location: United Kingdom
Re: Color Single Category Text
Thank you Jay!
I used this code to make the parent category text to bold:
I used this code to make the parent category text to bold:
- Code: Select all
#category > ul > li > a {
font-weight:bold;
}
-

dramony - Posts: 258
- Joined: Sat Oct 24, 2009 4:34 am
Re: Color Single Category Text
Ah, figured it was the link not the li you wanted

Better Product SEO URL's - Perfectly structured product links
Better Category SEO URL's - Give subcategories the same SEO keyword
SEO URL's Route Editor - Fix all of your index.php links

-

JAY6390 - Posts: 4636
- Joined: Wed May 26, 2010 3:47 pm
- Location: United Kingdom
Re: Color Single Category Text
I editted this line in my controller
and build in my CSS
ect, etc. for the next categories
but my problem is that the image in front of my text is not centered
I also tried
but then the image is in my text.
does anyone have a solution to this problem
- Code: Select all
$output .= '<li id="category-'. $result['category_id'].'">';
and build in my CSS
- Code: Select all
#category-21 {
list-style: url('../image/twee.png');
list-style-position:outside;
}
#category-21 li {
background:#e9b447;
}
ect, etc. for the next categories
but my problem is that the image in front of my text is not centered
I also tried
- Code: Select all
#category-20 {
background: url('../image/een.png') center left no-repeat;
}
but then the image is in my text.
does anyone have a solution to this problem
- k2tec
- Posts: 418
- Joined: Mon Apr 12, 2010 12:06 pm
11 posts
• Page 1 of 1
Who is online
Users browsing this forum: sammysomerset and 16 guests














