Adding livesearch functionality to non-plugin search form

Creating and modifying plugins.
Post Reply
User avatar
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Adding livesearch functionality to non-plugin search form

Post by yellowled » Fri Dec 30, 2011 3:03 pm

In 2k11, I use a "non-plugin" search form hardcoded into the template to make up for the non-HTML5 markup emitted by the quicksearch plugin. However, this will not "adapt" functionality added by plugins to the quicksearch sidebar plugin like i.e. livesearch.

Is there a way to add i.e. livesearch functionality to hardcoded search forms? Some kind of hook I can use?

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Adding livesearch functionality to non-plugin search for

Post by garvinhicking » Fri Dec 30, 2011 3:37 pm

Hi!

The generate_content() of the quicksearch plugin uses the eventhook "quicksearch_plugin", so you should be able to hook that in smarty as well (probably using hookAll=true).

Note though that the livesearch plugin (which is the only plugin using that hook) emits code that relies on the input search field having the DOM ID "#serendipityQuickSearchTermField" and the <form> tag surround it needs to be called "#searchform".

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/

User avatar
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: Adding livesearch functionality to non-plugin search for

Post by yellowled » Fri Dec 30, 2011 6:20 pm

garvinhicking wrote:The generate_content() of the quicksearch plugin uses the eventhook "quicksearch_plugin", so you should be able to hook that in smarty as well (probably using hookAll=true).
Hm, I have:

Code: Select all

{serendipity_hookPlugin hook="quicksearch_plugin" hookAll="true"}
after the code for the search form. So if I understand you correctly, it probably just does not work now because 2k11 doesn't use the ids you mentioned?

YL
amazon Wishlist - Serendipity-Podcast (German only, sorry)

User avatar
garvinhicking
Core Developer
Posts: 30020
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Adding livesearch functionality to non-plugin search for

Post by garvinhicking » Fri Dec 30, 2011 10:20 pm

Hi!

Yes, if the IDs do not match it will definitely not work.

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