Forums / Templates, Stylesheets, Page Layout / remove link from category name

remove link from category name

Views: 1,063

Results 1 to 10 of 10
20 Mar 2012, 2:54 AM
#1
godt avatar

godt

Zen Follower

Join Date:
Mar 2006
Location:
Melbourne, Australia
Posts:
378
Plugin Contributions:
0

remove link from category name

How do I remove the link function from:

<? php echo '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_GETcPath, 'NONSSL') . '">' . $category_icon_display_name . '</a>'; ?>
20 Mar 2012, 3:14 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: remove link from category name

Back up a bit ... what business issue brings you to the place of asking that specific technical question?
What's the problem you're trying to solve? and why?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Mar 2012, 3:23 AM
#3
godt avatar

godt

Zen Follower

Join Date:
Mar 2006
Location:
Melbourne, Australia
Posts:
378
Plugin Contributions:
0

Re: remove link from category name

Nothing complicated. I just don't want the category name at the top of the product page to function as a link, that being - I thought - the easiest way to apply css to that alone. I've spent half the day trying to work that out. The other half trying to get the category name to site next to the category icon, rather than below it. Failed on both counts!

20 Mar 2012, 3:30 AM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: remove link from category name

If your root purpose is to style the category name, that can be done without touching its link code. Seeing the page live will let us advise on the best way to move/style it.

20 Mar 2012, 4:57 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: remove link from category name

Try just changing a setting:
Admin->Configuration->Product Info->Previous Next - Navigation Includes Category Position ... set it to Off

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Mar 2012, 5:28 AM
#7
godt avatar

godt

Zen Follower

Join Date:
Mar 2006
Location:
Melbourne, Australia
Posts:
378
Plugin Contributions:
0

Re: remove link from category name

That leaves me neither icon or category name. I want to use both, with category name to the right of the icon, vertically aligned half way down the image, or thereabouts, and without the category name functioning as a link.

20 Mar 2012, 5:40 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: remove link from category name

Odd ... but ... whatever ...

Assuming the PHP code you quoted in your first post is indeed the correct code to deal with what you want to change (I've NOT checked that), then you would change it as follows ...

godt:

How do I remove the link function from:

<? php echo '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_GETcPath, 'NONSSL') . '">' . $category_icon_display_name . '</a>'; ?>

It's basic HTML inside a PHP statement, so removing the <a href>...</a> bit would become this:```

<?php echo $category_icon_display_name; ?>

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

20 Mar 2012, 6:00 AM
#9
godt avatar

godt

Zen Follower

Join Date:
Mar 2006
Location:
Melbourne, Australia
Posts:
378
Plugin Contributions:
0

Re: remove link from category name

Here is my tpl_modules_category_icon_display.php

<div align="<?php echo $align; ?>" id="categoryIcon" class="categoryIcon"><?php echo '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $_GET['cPath'], 'NONSSL') . '">' . $category_icon_display_image . $category_icon_display_name . '</a>'; ?> <?php echo $category_icon_display_name; ?></div>

My original post was code I had having separated the image from the name, but here, I revert to the whole thing. When I add the basic echo, as above, nothing at all appears!

20 Mar 2012, 6:28 AM
#10
godt avatar

godt

Zen Follower

Join Date:
Mar 2006
Location:
Melbourne, Australia
Posts:
378
Plugin Contributions:
0

Re: remove link from category name

Same with original code removed.