Suggestion for search results of static pages

Discussion corner for Developers of Serendipity.
Post Reply
Cenic
Regular
Posts: 20
Joined: Wed Jul 16, 2008 11:09 am

Suggestion for search results of static pages

Post by Cenic »

Hi,

I installed s9y a couple of days ago for the first time. I started playing around with some static pages and noticed that search results contain HTML tags (which I consider disturbing). Maybe you would like to implement the following change in plugins/serendipity_event_staticpage/plugin_staticpage_searchresults.tpl:

Instead of

Code: Select all

{$result.content|@escape:htmlall|@truncate:200:" ... "}
I used

Code: Select all

{$result.content|@strip_tags|@strip|@truncate:200:" ... "}
Looking at the smarty docs it seems that @strip_tags seems to be the prefered way of removing the tags. I also added @strip to collapse multiple spaces.

Regards,
Stefan
If Java had true garbage collection, most programs would delete themselves upon execution. (Robert Sewell)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Suggestion for search results of static pages

Post by garvinhicking »

Hi!

That's a better idea, yes. I just committed it to the tmeplate.

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/
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Good idea - I committed this suggestion to bulletproof for both 1.3 branch and 1.4 trunk.
=Don=
Don Chambers
Regular
Posts: 3652
Joined: Mon Feb 13, 2006 2:40 am
Location: Chicago, IL, USA
Contact:

Post by Don Chambers »

Now that I have added this to bp, it makes me wonder about something else, but I am not quite sure how to "fix" it.

If a quicksearch returns both entries and static page results, and the entries are multiple pages, the static page results appear on each page because they are displayed via {serendipity_hookPlugin hook="entries_footer"}. Any suggestions as to how to only display them on the first page?
=Don=
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

You could check for the GET variable that contains the page number? Or check the page number via Smarty itself, that is also used in the pagination output of entries.tpl.

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/
Post Reply