Page 1 of 1

Adding livesearch functionality to non-plugin search form

Posted: Fri Dec 30, 2011 3:03 pm
by yellowled
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

Re: Adding livesearch functionality to non-plugin search for

Posted: Fri Dec 30, 2011 3:37 pm
by garvinhicking
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

Re: Adding livesearch functionality to non-plugin search for

Posted: Fri Dec 30, 2011 6:20 pm
by yellowled
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

Re: Adding livesearch functionality to non-plugin search for

Posted: Fri Dec 30, 2011 10:20 pm
by garvinhicking
Hi!

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

Regards,
Garvin