Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Description with formatting on Category Listing page

Description with formatting on Category Listing page

Locked

Views: 3,439

Results 1 to 11 of 11
This thread is locked. New replies are disabled.
9 Sep 2009, 4:05 PM
#1
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Description with formatting on Category Listing page

Hello,

I have done some searching and I can’t find out how to add formatting to the short description on a Category Listing page. I know how to increase the length but not how to add formatting.

Thanks.
Michael
Buying zencart team a donut and cup of coffee very soon

9 Sep 2009, 4:23 PM
#2
schoolboy avatar

schoolboy

Totally Zenned

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

Re: Description with formatting on Category Listing page

Zencart strips out the html on listing pages, because you are able to set the length of displayed characters (it's a variable)... If you have html tags in this, you may truncate a tag and the displayed result will be a mess.

There is a technique to over-ride this (do a forum search), but it must be used with caution...

9 Sep 2009, 5:15 PM
#3
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: Description with formatting on Category Listing page

hello, I did a forum serach and could not find the over-ride

9 Sep 2009, 5:42 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Description with formatting on Category Listing page

Search the forums for zen_clean_html

9 Sep 2009, 11:27 PM
#5
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: Description with formatting on Category Listing page

I did a GREP search (text search within zencart install files)

and found /includes/modules/theme197/product_listing.php
(in default install would be /includes/modules/product_listing.php)

and replaced

. zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) .

with

. zen_trunc_string(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']), PRODUCT_LIST_DESCRIPTION) . 

Thanks that worked :smile:

9 Sep 2009, 11:37 PM
#6
gjh42 avatar

gjh42

Black Belt

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

Re: Description with formatting on Category Listing page

Note that you need to do the same thing in two adjacent lines in that file.

Also note that you need to set the product listing description length to longer than you will ever use, so that you will not risk truncating text with HTML formatting in it and leaving loose tags.

3 Jun 2010, 8:18 AM
#7
leest35 avatar

leest35

Zen Follower

Join Date:
May 2010
Location:
London UK
Posts:
134
Plugin Contributions:
0

Re: Description with formatting on Category Listing page

OK,

I know this post is a little old now but i am trying to add a back ground colour to the .wrapperAttribsOption which is a moded product listing file. However none of my formating makes any difference.

I have made the suggestions aboe, however none of the formating is displayed, well actually the page allows some formating just not other areas, however all of the formating works on the product info page.

Any suggestions would be appreciated,

Thanks

3 Jun 2010, 12:18 PM
#8
gjh42 avatar

gjh42

Black Belt

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

Re: Description with formatting on Category Listing page

We need to see exactly what you have now to give correct advice on changes.
There is no .wrapperAttribsOption associated with the product listing.

3 Jun 2010, 9:44 PM
#9
vandiermen avatar

vandiermen

Totally Zenned

Join Date:
Feb 2007
Posts:
518
Plugin Contributions:
1

Re: Description with formatting on Category Listing page

leest35:

OK,

I know this post is a little old now but i am trying to add a back ground colour to the .wrapperAttribsOption which is a moded product listing file. However none of my formating makes any difference.

I have made the suggestions aboe, however none of the formating is displayed, well actually the page allows some formating just not other areas, however all of the formating works on the product info page.

Any suggestions would be appreciated,

Thanks

I don’t think this post has anything to do with background color, I think this was a post to find a way to make the small product description have text formatting or something. I suggest starting a new post!

22 Oct 2010, 10:28 AM
#10
looserfoot avatar

looserfoot

New Zenner

Join Date:
Aug 2010
Posts:
5
Plugin Contributions:
0

Re: Description with formatting on Category Listing page

I need help. I have edited using these codes. It works on the top 2 products, only, how do I make it apply to all listings? Please see attached image. I want all listings to be formatted like the top image.

I changed the top code to the bottom code in includes / modules / product_listing.php There was only 2 instances to change.

. zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) .  

/////////////////////////////////
. zen_trunc_string(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']), PRODUCT_LIST_DESCRIPTION) .

All help appreciated.

Abbie
V1.3.9d
no mods installed

27 Oct 2010, 10:03 AM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: Description with formatting on Category Listing page

I need to see your site live to have any chance of finding out why it is behaving like that.

Are all of the listings you are referring to actually "product listings"? The tweak mentioned is only for that kind of listing.