Static page search results showing HTML code

Creating and modifying plugins.
Post Reply
locojoe
Regular
Posts: 42
Joined: Wed Oct 25, 2006 12:58 am

Static page search results showing HTML code

Post by locojoe »

When I do a search on my site the static page results are showing html code that is in that static page. i.e...



Found 3 static pages:

* Salem Township History (Randy)
All information on this page was taken from <a href="http://www.ukans.edu/carrie/kancoll/boo ... /">William G. Cutler's History of the State of Kansas</a>. ...
* Cowskin Creek (Randy)
<!-- s9ymdb:231 --><img width="384" height="288" style="float: right; border: 0px; padding-left: 5px; padding-right: 5px;" ...
* A Brief History Of Haysville (Randy)
<a class='serendipity_image_link' href='/hol/uploads/history/early_history/ww_hays.jpg'><!-- s9ymdb:227 --><img width="109" height="120" ...

Thanks.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Static page search results showing HTML code

Post by garvinhicking »

Hi!

Yes, if you do not want HTML tags you can modify the plugin_staticpage_searchresults.tpl file.

ReplacE:

Code: Select all

 {$result.content|@escape:htmlall|@truncate:200:" ... "}
with, for example:

Code: Select all

 {$result.content|strip_tags|@truncate:200:" ... "}
The problem is if you remove escape or strip_tags, the truncate command will cut your HTML tags in the middle and provide invalid HTML markup. That's why by default, no HTML is parsed. There's a thread here in the forums somewhere about the techincal difficulties with this.

Regards,
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/
locojoe
Regular
Posts: 42
Joined: Wed Oct 25, 2006 12:58 am

Post by locojoe »

Thanks Garvin!
Post Reply