Page 1 of 6 123 ... LastLast
Results 1 to 10 of 51
  1. #1
    Join Date
    Aug 2007
    Posts
    94
    Plugin Contributions
    0

    Default Customizing Product Description Text Formatting on Category Page

    I'm going to start a separate thread for this question. Referencing this page...

    *** URL removed *** index.php?main_page=product_info&cPath=1

    You can see that the "preview text" of the product description here doesn't have the proper formatting that it does on the actual product page shown here...

    *** URL removed *** /index.php?main_page=product_info&cPath=1&products_id=1

    How can this be resolved?

    Ideally, to be honest, I'd like that preview text to be different than the full text on the product page. Any tips on either of these?

    Thanks for the great forum support, I've found about all the answers I seek so far.

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

    Default Re: Customizing Product Description Text Formatting on Category Page

    This looks like a good opportunity to post a mod I've had on the back burner for a while. I worked this out a few months ago here; the current version is just tidied up from that.

    This is more complex than your requirement, but can be simplified to fit.

    ################################################################################____

    Multiple Product Descriptions
    ################################################################################____

    This mod gives the ability to have different descriptions in product listing and product info pages, and different parts of the info page description in different places.


    First you need to allow HTML to function on the product listing page. Edit /includes/modules/your_template/product_listing.php to comment out zen_clean_html in two places around lines 98 & 100, as explained in this thread. You may also need to do a similar thing in products_all_listing.php (not sure of the filename) to allow HTML on the all products page.

    It is also necessary to set the product listing description to allow a larger number of characters than you are ever likely to use (Configuration > Product Listing), so HTML tags don't get truncated. That would be bad. I set mine to 2000.


    Enter all the different parts you want to display, with <span class=productDescList>text text text</span><span id=productDesc1>text text text</span><span id=productDesc2>text text text</span> tags around each section.
    Put the short description for listing pages in productDescList, and blocks for the info page in 1, 2, etc.
    You can use this as a template to paste into the description textarea and fill in:
    HTML Code:
    <span class=productDescList>your text here
    </span>
    <span id=productDesc1>your text here
    </span>
    <span id=productDesc2>your text here
    </span>
    Copy the product description block in tpl_product_info_display to all the locations where you want to display a section of text, and give each block (including the original) a separate id.
    PHP Code:
     <!--bof Product description -->
    <?php if ($products_description != '') { ?>
    <div id="productDescription1" class="biggerText productGeneral"><?php echo stripslashes($products_description); ?></div>
    <?php ?>
    <!--eof Product description -->
    <br class="clearBoth" />
    Give any desired styling to each description block.
    In your stylesheet, find #productDescription and change it to #productDescription1. Below that declaration, add

    #productDescription2 {your desired styling} etc.

    Next, turn off all display of #productDesc1 and #productDesc2 etc., and .productDescList in the product info page, and turn them on again selectively.

    Code:
    #productGeneral .productDescList, #productDesc1, #productDesc2 { display: none; }
    
    #productDescription1 #productDesc1 { display: block; } /*or inline*/
    
    #productDescription2 #productDesc2 { display: block; }
    The desired parts of the description will display in their respective locations.

  3. #3
    Join Date
    Aug 2007
    Posts
    94
    Plugin Contributions
    0

    Default Re: Customizing Product Description Text Formatting on Category Page

    Awesome - thanks so much for posting. Once again I'll have to work on this in the evening but I'm pumped about trying it.

  4. #4
    Join Date
    Aug 2007
    Posts
    94
    Plugin Contributions
    0

    Default Re: Customizing Product Description Text Formatting on Category Page

    Thanks for the help - pardon my ignorance as I'm still waiting on my CSS lesson from a friend. For this block of text below, what file to do enter this in? I may be requesting some hand holding here, but perhaps by the time we're done I can summarize it into a very basic step by step for others...


    Enter all the different parts you want to display, with <span class=productDescList>text text text</span><span id=productDesc1>text text text</span><span id=productDesc2>text text text</span> tags around each section.
    Put the short description for listing pages in productDescList, and blocks for the info page in 1, 2, etc.
    You can use this as a template to paste into the description textarea and fill in:

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

    Default Re: Customizing Product Description Text Formatting on Category Page

    Sorry for not being explicit there - you would save that "template" block of text as a text file somewhere handy on your computer, and copy & paste it into the description field when you are creating a new product. Then you just add your text in place of the "your text here".

    For a quick start on CSS, check out www.w3schools.com - they have tutorials and interactive examples where you can actually practice live.

  6. #6
    Join Date
    Aug 2007
    Posts
    94
    Plugin Contributions
    0

    Default Re: Customizing Product Description Text Formatting on Category Page

    Great thanks I'll look at this again.

  7. #7
    Join Date
    Mar 2007
    Posts
    9
    Plugin Contributions
    0

    Default Re: Customizing Product Description Text Formatting on Category Page

    great contribution and directions. Have a small problem, all my description boxes are different sizes and misaligned, any ideas on how to fix this.
    Also one of my products doesnt have a description2 boxes

    any help would be great,

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

    Default Re: Customizing Product Description Text Formatting on Category Page

    You can use the classes and ids in your stylesheet to fine-tune the size, shape, position, font and other characteristics of the individual description areas. If a particular product doesn't have any text to go in #productDesc2, leave it empty (or eliminate the <span id=productDesc2>your text here</span>) and if it has no borders or background color it will at most add a small blank space where it would usually display.

  9. #9
    Join Date
    Mar 2007
    Posts
    9
    Plugin Contributions
    0

    Default Re: Customizing Product Description Text Formatting on Category Page

    The problem is in the description boxes in the admin area. they are now aligned like
    xxx
    xx
    x
    x
    x
    xx
    xxx
    The lines at the bottom of the page where you can add a pic and everything are misaligned too. I looked at the style sheet but I think its for the webpage not the admin area. Is there a style sheet for the admin area?

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

    Default Re: Customizing Product Description Text Formatting on Category Page

    There should be a separate stylesheet for admin, and any editing you have done to your template stylesheet can have no effect on admin. Zen Cart will never see the template stylesheet when rendering admin pages. So I don't know what could have happened to your display.

    Can you post a screenshot of the display? (Obviously you can't post your admin for us to look at live.)

 

 
Page 1 of 6 123 ... LastLast

Similar Threads

  1. Description with formatting on Category Listing page
    By vandiermen in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 27 Oct 2010, 11:03 AM
  2. Formatting text in category description
    By chuckr in forum Customization from the Admin
    Replies: 1
    Last Post: 2 Aug 2010, 07:35 PM
  3. Formatting text in product description
    By TonyB6 in forum Customization from the Admin
    Replies: 5
    Last Post: 3 May 2010, 03:01 AM
  4. Formatting category description issue
    By godt in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 Feb 2009, 04:40 AM
  5. Customizing Product Category Page
    By Ahroo in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 14 Jun 2007, 05:38 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR