Results 1 to 10 of 11

Hybrid View

  1. #1
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    help question 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

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default 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...
    20 years a Zencart User

  3. #3
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default Re: Description with formatting on Category Listing page

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

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Description with formatting on Category Listing page

    Search the forums for zen_clean_html

  5. #5
    Join Date
    Feb 2007
    Posts
    513
    Plugin Contributions
    2

    Default 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

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

    PHP Code:
    zen_trunc_string(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']), PRODUCT_LIST_DESCRIPTION) . 
    Thanks that worked
    Last edited by vandiermen; 10 Sep 2009 at 12:30 AM.

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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.

  7. #7
    Join Date
    Aug 2010
    Posts
    5
    Plugin Contributions
    0

    Default 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.

    Code:
    . 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

  8. #8
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default 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.

 

 

Similar Threads

  1. Category description at top of product listing page
    By Jgall in forum Customization from the Admin
    Replies: 4
    Last Post: 17 Jan 2012, 02:56 PM
  2. Customizing Product Description Text Formatting on Category Page
    By Bahnstoermer in forum Setting Up Categories, Products, Attributes
    Replies: 50
    Last Post: 17 Dec 2010, 11:54 AM
  3. Formatting text in category description
    By chuckr in forum Customization from the Admin
    Replies: 1
    Last Post: 2 Aug 2010, 07:35 PM
  4. Formatting category description issue
    By godt in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 Feb 2009, 04:40 AM
  5. Category Page Formatting Question -
    By kettlewell in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Dec 2008, 11:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg