Board index Plugins Adding livesearch functionality to non-plugin search form

Creating and modifying plugins.
User avatar
yellowled
Regular
 
Posts: 6627
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany

Postby yellowled » Fri Dec 30, 2011 4: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

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

Postby garvinhicking » Fri Dec 30, 2011 4: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: 6627
Joined: Fri Jan 13, 2006 12:46 pm
Location: Eutin, Germany

Postby yellowled » Fri Dec 30, 2011 7: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

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

Postby garvinhicking » Fri Dec 30, 2011 11: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/



Return to Plugins

Who is online

Users browsing this forum: No registered users and 1 guest

cron