+ Reply to Thread
Results 1 to 4 of 4

Thread: How can I truncate the description field for use in Browse/search results page?

  1. #1
    Member
    Join Date
    Sep 2016
    Location
    Spain
    Posts
    35

    How can I truncate the description field for use in Browse/search results page?

    I want to use some text from the description in my browse lists but it looks ridiculous to use all of it as it is long. A long description is good when a visitor is wanting all information about a property but not for the browse page.

    Does anyone know how I can take the first section of the description field, say 250 characters or so and show it underneath the thumbnail as other sites do?

    Can I use any text functions to strip off this or can I copy part of it into another field and show this field with say "..." at the end?

    Many thanks
    John

  2. #2
    Guru
    Join Date
    Jan 2013
    Location
    Australia
    Posts
    2,026
    John, One way is to restrict the length of your description field to your required length (see numbers below that work best for seo outcomes, as these match giggles and most search engine guidelines), then add a third listing field called listing details that can be as long as you want.

    This would look like

    Listing Title (70 Chars)
    Listing Description (160 Chars)
    Listing Details (Optional)

    There are also ways to add the … but it is easier to control using the above method, that way in short / featured form you show, title and description and everything is regulated to size and works on your site, and when people click on this they get the full story in the details section.
    Getting Started or Starting Over with Your Classified Site? then Get Ready Set Fly V 4.7.1 > quietSecrets.net

  3. #3
    Member
    Join Date
    Sep 2016
    Location
    Spain
    Posts
    35
    Thanks, Pete. It may be easier for me to add a "short description" field. I will experiment. What I really wanted was to be able to truncate the description field with a function, like left(description,250) to grab the first 250 bytes of it rather than create another field but it is a possibe solution so thanks.

  4. #4
    Member
    Join Date
    Sep 2016
    Location
    Spain
    Posts
    35
    I got a better/easier solution provided by Rudi from support. Many thanks, Rudi this worked well. He suggested that I amend the css template to limit the height of the description field displayed on the browse pages. Exactly what I wanted.

    His email:-

    "So you need to shrink description text on browse page?

    go to ftp > templates > your template > css > style.css > find a row section#listings.list ul.info > li.fields (~567 row)

    and add a new feature:

    max-height: 52px;
    "

    I actually experimented and found that 150px gives a reasonable amount of tect per listing without getting rediculous.

    Be sure to clear cache after the change or you won't see it!

    John

+ Reply to Thread