The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

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

Creating and modifying plugins.
User avatar
yellowled
Regular
 
Posts: 5632
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: 29534
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: 5632
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: 29534
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 2 guests

cron