Gossamer Forum
Home : Products : Links 2.0 : Customization :

Truncate text of Description field on Search Results

Quote Reply
Truncate text of Description field on Search Results
I'm using a custom search results template where the Description field is printed under the link Title. I'd like to output only the first 100 characters of the Description, and end it with " ..." if there is additional text.

In searching the forums, I found a thread which references truncating the Title field using the following code: $link{'Title'} =~ s/^(.{25}).*$/$1.../;

Can anyone help me figure out how to modify this for the Description field? And where do I place it? In search.cgi, and/or in site_html_templates? I've tried a couple of things but no cigar.

Thanks -
Subject Author Views Date
Thread Truncate text of Description field on Search Results RickG 1130 Aug 20, 2002, 5:16 AM
Post Re: [RickG] Truncate text of Description field on Search Results
RickG 1104 Aug 21, 2002, 11:08 AM