Hi guys, I've been looking at the trackbacks in the admin suite and notice that they are a truncated version of the entry with a few words before or after the link. Is it possible to do the same thing with search results so that the results display x many words before and after the first instance of the search term? Is it also possible to do this with Smarty in the template?
I think this would be a very nice touch for our themes.
Carl
Feature request quicksearch plugin
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Feature request quicksearch plugin
Hi Carl!
You could be able to do that with 'truncate' in your smarty template:
However, I personally always liked the way that I see the complete results of my search, and not just excerpts. Because I usually use a very general searchterm when searching a blog and then narrow it down with my browser search functions....
HTH,
garvin
You could be able to do that with 'truncate' in your smarty template:
Code: Select all
{if $searchresult_results}
{$entry.body|truncate:200}
{else}
{$entry.body|truncate:200}
[/if}
HTH,
garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/