Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / Change Appearance of Selected All & New Products Link

Change Appearance of Selected All & New Products Link

Locked

Started by dmfelder on 1 Mar 2009, 1:03 AM · Views: 2,088

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
1 Mar 2009, 1:03 AM
#1
dmfelder avatar

dmfelder

Zen Follower

Join Date:
Nov 2006
Posts:
102
Plugin Contributions:
0

Post #1 by dmfelder

When I click on a "normal" category link in my categories sidebox, the link itself becomes bold font (and the page loads). When I click the "all products" and "new products" links in the categories sidebox, the page loads, but the font does not change in the sidebox link.

How can I also make the font bold when I click the "all products" and "new products" in the categories sidebox?

There doesn't seem to be a simple solution. I have searched my stylesheet and this forum. The normal links use:

class="category-subs-selected"

to designate it's been selected, and CSS takes over from there...

DMFelder | Visit GreatApparelForYou.com for Chicago Direct to Garment printing and Chicago Screen Printing and for Funny Tees and shirts go to gafy.com. We also have Eco-Friendly Printing services.

1 Mar 2009, 1:04 AM
#2
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,192
Plugin Contributions:
0

Post #2 by haredo

Dm,
Post me a link to your site please....

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

1 Mar 2009, 1:21 AM
#3
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,192
Plugin Contributions:
0

Post #3 by haredo

dmfelder:

When I click on a "normal" category link in my categories sidebox, the link itself becomes bold font (and the page loads). When I click the "all products" and "new products" links in the categories sidebox, the page loads, but the font does not change in the sidebox link.

How can I also make the font bold when I click the "all products" and "new products" in the categories sidebox?

There doesn't seem to be a simple solution. I have searched my stylesheet and this forum. The normal links use:

class="category-subs-selected"

to designate it's been selected, and CSS takes over from there...

Dm,
add this to your_template/ stylesheet.css

A.category-links:hover {font-weight: bold;}

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.

Zen Cart Certified hosting at myZenCartHost.com.

1 Mar 2009, 6:14 PM
#4
dmfelder avatar

dmfelder

Zen Follower

Join Date:
Nov 2006
Posts:
102
Plugin Contributions:
0

Post #4 by dmfelder

Thanks, Haredo.

Unfortunately, that's just a mouse-over event before the page loads. I would like the words "All Products..." to be highlighted on the page when that specific page is loaded.

You'll see what I mean here:

sickbrands.com/sickcart

When you click on any normal category, the page loads and the respective category link in the sidebox is highlighted (bold & yellow). It works for everything but All Products and New Products.

Unlike the normal categories, there doesn't seem to be a "selected" <SPAN> field for me to identify in CSS. This seems weird to me, because I would imagine almost everyone would want these links to perform the same as the category links.

DMFelder | Visit GreatApparelForYou.com for Chicago Direct to Garment printing and Chicago Screen Printing and for Funny Tees and shirts go to gafy.com. We also have Eco-Friendly Printing services.

1 Mar 2009, 6:45 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #5 by gjh42

You will need to add a test for current page to affect the span output.
For example, to highlight the "All Products..." link, find this in
/includes/templates/your_template/sideboxes/tpl_categories.php:```php
if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
$content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '">' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</a>' . "\n";
}


<span' . (($current_page_base == 'products_all')? ' class="category_links_selected"': '') . '>'

and 

</span>

to get```php
    if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
      $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '"><span' . (($current_page_base == 'products_all')? ' class="category_links_selected"': '') . '>' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</span></a>' . "\n";
    }

The other links will need similar treatment.

1 Mar 2009, 10:51 PM
#6
dmfelder avatar

dmfelder

Zen Follower

Join Date:
Nov 2006
Posts:
102
Plugin Contributions:
0

Post #6 by dmfelder

YOU are awesome, thanks! I think you left out a <li> element, but that's a great and simple solution!

For anyone else interested, here is the updated code:

 
if (SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
$content .= '<li><a class="category-links" href="' . zen_href_link(FILENAME_PRODUCTS_ALL) . '"><span' . (($current_page_base == 'products_all')? ' class="category_links_selected"': '') . '>' . CATEGORIES_BOX_HEADING_PRODUCTS_ALL . '</span></a></li>' . "\n";
} 

Then make a simple addtion to your CSS stylesheet for category_links_selected.

Piece of cake!

Thanks again!

DMFelder | Visit GreatApparelForYou.com for Chicago Direct to Garment printing and Chicago Screen Printing and for Funny Tees and shirts go to gafy.com. We also have Eco-Friendly Printing services.

1 Mar 2009, 11:54 PM
#7
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #7 by gjh42

The standard Zen Cart categories sidebox does not have <li> elements, just <a> links separated by <br /> to keep them in a column.
Some templates and mods have reworked the categories into a list, which makes more sense.