Hey, an update should be coming soon 😉! I’m shure Pascal Kriete will post it here.
Yeah…. 😊
Anyway, I figured it out and it’s something I should have checked sooner. The plugin has a trailing comma in the return JSON formatted string. While FF, Safari and other browsers play well with this, IE thinks there is a missing item because of it.
The newest version is up. I’ve attached it to the first post until I get the download section of my site up and running.
Now with more awesome! Along with IE support it also adds two js options: width and center_results Example:
// Make the result box 200px wide and center it
$('#keywords').livesearch('http://example.com/search_results/livesearch/', {
width: '200',
center_results: true
});
Hiya,
Sorry it wasn’t meant to sound like sarcasm. My British humour getting the worst of me again!
I was just explaining what I thought he meant by it and the speech bit was just a copy of what had been said before, thus the wink.
Sorry about that it was never my intention for sarcasm, I try my best to steer clear of that beast wherever I can.
Best wishes,
Mark
Many thanks for this most excellent plugin! I’ve got it installed and working… now, I just have to customize it to work as planned on my site.
My home page includes a program search and a presenter search (in addition to a standard keyword search) and I’d like to use livesearch for both of these, having the fields autosuggest titles from those two specific blogs only. So, based on that, I have two questions for you:
1) I have three search boxes running on the home page of my site – I’d like to implement livesearch on two of them. They all have unique ids (keywords, keywords2, keywords3) and I’ve modified the script to use the correct id, e.g.,
<scr*pt type="text/javascript" charset="utf-8">
$('#keywords2').livesearch('{site_url}includes/livesearch/');
</scr*pt>
Livesearch is working on the first of these search boxes, but not on the second. Any tips as to how I might further adjust to make this work? I tried creating & linking to a second livesearch template (includes/livesearch2) as a quick fix but this did not work…
2) Perhaps more important, is there any way to restrict the livesearch to a single blog? My search form is restricted, but livesearch is currently searching all entries and pulling up titles of entries (marker entries, admin guide) that should not be public.
Is this possible within the parameters of livesearch as currently constructed?
Thanks!
1) I have three search boxes running on the home page of my site – I’d like to implement livesearch on two of them. They all have unique ids (keywords, keywords2, keywords3) and I’ve modified the script to use the correct id, e.g.,<scr*pt type="text/javascript" charset="utf-8"> $('#keywords2').livesearch('{site_url}includes/livesearch/'); </scr*pt>
That’s what I would’ve done - I will take a look in a moment.
2) Perhaps more important, is there any way to restrict the livesearch to a single blog? My search form is restricted, but livesearch is currently searching all entries and pulling up titles of entries (marker entries, admin guide) that should not be public.
As of right now, it’s not available as a parameter. I have plans to do a major overhaul once EE2 is out to add features like this. For now, you can easily add it. Change this:
$sql = "SELECT distinct(a.entry_id), a.url_title, a.title, b.blog_url, b.comment_url
FROM exp_weblog_titles a, exp_weblogs b
WHERE a.weblog_id = b.weblog_id
AND a.status != 'closed'
AND (a.expiration_date > '".$LOC->now."' OR a.expiration_date = '0')
AND a.title LIKE '%{$search_phrase}%'
ORDER BY a.title ASC LIMIT 0,10";
To this:
$sql = "SELECT distinct(a.entry_id), a.url_title, a.title, b.blog_url, b.comment_url
FROM exp_weblog_titles a, exp_weblogs b
WHERE a.weblog_id = b.weblog_id
AND a.status != 'closed'
AND (a.expiration_date > '".$LOC->now."' OR a.expiration_date = '0')
AND a.title LIKE '%{$search_phrase}%' ";
if( $weblog = $TMPL->fetch_param('weblog') )
{
$sql .= "AND b.blog_name = '{$weblog}' ";
}
$sql .= "ORDER BY a.title ASC LIMIT 0,10";
Untested, but that should allow you to do: {exp:live_search:results weblog="weblogshortname"}
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.