Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do I remove sub-catagory text if I have a catagory image?

How do I remove sub-catagory text if I have a catagory image?

Views: 3,363

Results 1 to 12 of 12
17 Feb 2011, 12:45 AM
#1
curbsidestudiosnet avatar

curbsidestudiosnet

New Zenner

Join Date:
Jun 2010
Posts:
32
Plugin Contributions:
0

How do I remove sub-catagory text if I have a catagory image?

alrighty, here it goes. On this page, it has the sub-catagries listed in text. I was wondering how to remove this text without it dissapearing in the top left catagories box.

Basically, I just want the catagory image to show. I tried removing the parts of my SS but it is not LEAVING.

Note: I have look around the forum for the answer to this and have not found it.

17 Feb 2011, 1:45 AM
#2
gjh42 avatar

gjh42

Black Belt

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

Re: How do I remove sub-catagory text if I have a catagory image?

If you want the same effect for all categories, try Configuration > Product Listing > Show SubCategories on Main Page while navigating.

17 Feb 2011, 1:51 AM
#3
gjh42 avatar

gjh42

Black Belt

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

Re: How do I remove sub-catagory text if I have a catagory image?

If you want the link to General Information, you can put that link in the category description.

17 Feb 2011, 11:49 PM
#4
curbsidestudiosnet avatar

curbsidestudiosnet

New Zenner

Join Date:
Jun 2010
Posts:
32
Plugin Contributions:
0

Re: How do I remove sub-catagory text if I have a catagory image?

gjh42:

If you want the same effect for all categories, try Configuration > Product Listing > Show SubCategories on Main Page while navigating.

That works but it also removes the sub-catagory image. I just want to replace the sub catagory text with an image

18 Feb 2011, 1:02 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: How do I remove sub-catagory text if I have a catagory image?

Okay, you want the subcategories' images to show in the listing, but not their names. Do you want the regular category images that can be uploaded in the category edit page? If so, all you need is to remove the text output. Copy /includes/modules/category_row.php to /includes/modules/your_template/category_row.php, find this```php
$list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '<br />' . $categories->fields['categories_name'] . '</a>');


 . '<br />' . $categories->fields['categories_name']

to get this```php
    $list_box_contents[$row][$col] = array('params' => 'class="categoryListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
                                           'text' => '<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">' . zen_image(DIR_WS_IMAGES . $categories->fields['categories_image'], $categories->fields['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>');
19 Feb 2011, 5:18 PM
#6
curbsidestudiosnet avatar

curbsidestudiosnet

New Zenner

Join Date:
Jun 2010
Posts:
32
Plugin Contributions:
0

Re: How do I remove sub-catagory text if I have a catagory image?

Could you have made a mistake? It doesn't seem to be working.

It didn't do a thing!

19 Feb 2011, 5:27 PM
#7
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How do I remove sub-catagory text if I have a catagory image?

Looking at your sample page, I no longer see sub categories.

But I use the following CSS declarations. They must appear in the ORDER they appear below, because the first one tells all subcategory links to be not visible, then the second one overrides the first for the IMAGE links.

.categoryListBoxContents a {visibility:hidden;}
.categoryListBoxContents a img {visibility:visible;}

Put it at the bottom of the stylesheet and your category IMAGES will show as links, but not the TEXT.

19 Feb 2011, 5:37 PM
#8
curbsidestudiosnet avatar

curbsidestudiosnet

New Zenner

Join Date:
Jun 2010
Posts:
32
Plugin Contributions:
0

Re: How do I remove sub-catagory text if I have a catagory image?

schoolboy:

Looking at your sample page, I no longer see sub categories.

But I use the following CSS declarations. They must appear in the ORDER they appear below, because the first one tells all subcategory links to be not visible, then the second one overrides the first for the IMAGE links.

.categoryListBoxContents a {visibility:hidden;}
.categoryListBoxContents a img {visibility:visible;}

Put it at the bottom of the stylesheet and your category IMAGES will show as links, but not the TEXT.

Thanks so much schoolboy! Jesus.....such an easy fix for someone that knows how to do that. Thank YOU!

19 Feb 2011, 5:43 PM
#9
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How do I remove sub-catagory text if I have a catagory image?

There is an argument that the {visibility:hidden} declaration - particularly on TEXT elements, may be "detrimental" to SEO, but as ZC will auto-generate ALT tags for your category images anyway, this should not be an issue.

The jury is out on the SEO discussion. Know that Google uses {visibility:hidden} itself, so it can't be that serious.

19 Feb 2011, 6:08 PM
#10
curbsidestudiosnet avatar

curbsidestudiosnet

New Zenner

Join Date:
Jun 2010
Posts:
32
Plugin Contributions:
0

Re: How do I remove sub-catagory text if I have a catagory image?

preciate the info, I will check into that myself. Now you got me wondering.

19 Feb 2011, 6:33 PM
#11
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: How do I remove sub-catagory text if I have a catagory image?

well, we've built about 150 zencart stores over the years and we use the visibility:hidden and diplay:none declarations in various places on MOST of these sites.

We have never had any impression that their use has had a detrimental effect on SEO.

In fact, on some sites where these declarations are quite widely used, we are getting onto page 1 and 2 of google on many competitive keywords.

I don't think you need to worry about it. I just felt it important to alert you to the debate.

20 Feb 2011, 2:05 AM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: How do I remove sub-catagory text if I have a catagory image?

Re post 6: If you edited exactly as described, and saved the file successfully to the correct custom folder, it would have to work because there would no longer be code to output the name. If you made a mistake in what you edited or where it saved, it could have not worked.

If the CSS solution works, great. I have tried similar things with display: none; and failed, but the visibility: hidden; may work differently enough to avoid the pitfall.