Forums / Templates, Stylesheets, Page Layout / Help to remove unwanted break tags

Help to remove unwanted break tags

Views: 1,258

Results 1 to 5 of 5
7 Jan 2014, 3:32 AM
#1
longstockings avatar

longstockings

Zen Follower

Join Date:
Jul 2004
Posts:
198
Plugin Contributions:
0

Help to remove unwanted break tags

Hi

On my product listing page are 2 break tags that I would like to remove that do not appear in includes/modules/product_listing.php.

<div class="product_image"><a href="http://www.handcoded.co.uk/barn/petzl-basic-p-445.html"><img src="images/BASIC.jpg" alt="Petzl Basic" title=" Petzl Basic " width="130" height="130" class="listingProductImage"></a></div><br> <div class="product_name"><a href="http://www.handcoded.co.uk/barn/petzl-basic-p-445.html">Petzl Basic...</a></div><br>

Example page = http://goo.gl/R6M7Hj

Thanks

UK based Zen Cart Web Designer here https://www.handcoded.co.uk

7 Jan 2014, 3:39 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Help to remove unwanted break tags

longstockings:

Hi

On my product listing page are 2 break tags that I would like to remove that do not appear in includes/modules/product_listing.php.

<div class="product_image"><a href="http://www.handcoded.co.uk/barn/petzl-basic-p-445.html"><img src="images/BASIC.jpg" alt="Petzl Basic" title=" Petzl Basic " width="130" height="130" class="listingProductImage"></a></div><br> <div class="product_name"><a href="http://www.handcoded.co.uk/barn/petzl-basic-p-445.html">Petzl Basic...</a></div><br>

Example page = http://goo.gl/R6M7Hj

Thanks

You say not in modules/product_listing, but what about in the applicable tpl file? Tpl_product_listing? Located either in your template/templates folder or in the template_default/templates folder.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

7 Jan 2014, 1:36 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,116
Plugin Contributions:
56

Re: Help to remove unwanted break tags

Add to the bottom of your stylesheet.css:

#productListing .product_image+br { display: none; }

That styling says that within the element with an id of productListing (on the product listing page only), don't display any br's that directly follow something with a class of product_image.

7 Jan 2014, 3:51 PM
#4
longstockings avatar

longstockings

Zen Follower

Join Date:
Jul 2004
Posts:
198
Plugin Contributions:
0

Re: Help to remove unwanted break tags

lat9:

Add to the bottom of your stylesheet.css:

#productListing .product_image+br { display: none; }

> That styling says that within the element with an id of productListing (on the product listing page only), don't display any br's that directly follow something with a class of product_image.

This worked perfectly. Thanks very much

UK based Zen Cart Web Designer here https://www.handcoded.co.uk

7 Jan 2014, 4:45 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: Help to remove unwanted break tags

Your template appears to use the "what's new" centerbox code for the product listing pages, customized some from the original version of that file, as the original has <br /> instead of the not-strictly-HTML-valid <br> in yours.

Look at /includes/modules/your_template/new_products.php. The original at /includes/modules/new_products.php has```php
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsNew centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($new_products->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $new_products->fields['products_image'], $new_products->fields['products_name'], IMAGE_PRODUCT_NEW_WIDTH, IMAGE_PRODUCT_NEW_HEIGHT) . '</a><br />') . '<a href="' . zen_href_link(zen_get_info_page($new_products->fields['products_id']), 'cPath=' . $productsInCategory[$new_products->fields['products_id']] . '&products_id=' . $new_products->fields['products_id']) . '">' . $new_products->fields['products_name'] . '</a><br />' . $products_price);

Yo mention /includes/modules/product_listing.php, but do you have a file at /includes/modules/your_template/product_listing.php?
It is possible that the template maker just substituted the what's new code for some of the original code in product_listing.php, and if so, they should have put the edited file in a template override folder.

Look in admin > Tools > Developers Toolkit for centerBoxContentsNew which is in the source of your product listing page. Paste centerBoxContentsNew in the lower left box, select "all files" and search. This will show you all places where the text is used.