Page 1 of 1

Static page search results showing HTML code

Posted: Sun Nov 25, 2007 4:49 pm
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.

Re: Static page search results showing HTML code

Posted: Sun Nov 25, 2007 5:43 pm
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

Posted: Sun Nov 25, 2007 6:04 pm
by locojoe
Thanks Garvin!