MD Live Search

Add a Live Search to your ExpressionEngine Control Panel for weblog entries and comments.

Download MD Live Search 1.2.1

This version posted March 5, 2009
This ExpressionEngine add-on is available at GitHub.
Visit the GitHub page and click "Download", and then click either "Zip" or "Tar".

I use Mark Huot’s Live Search extension on most of the sites I’ve built with EE, but I thought it could use a few updates, including the ability to show the date of the entry, the weblog, and the status. I’ve updated the extension with these extras (as settings) as well as a couple other settings. I initially intended to convert this to jQuery, but that proved to be a bit beyond my current coding skills – so this is still a self-contained file. Thanks to Mark Huot for giving me the OK to release this.

  • MSM Aware
  • Works with LG Addon Updater to let you know if the version you’re using is outdated
MD Live Search

Basic Steps for Installing and Using MD Live Search

  1. Download the script from GitHub
  2. Put the ext.md_live_search.php file in your extensions folder
  3. Put the lang.md_live_search.php file in your language/english folder
  4. Enable the extension, and modify any of the settings you need
MD Live Search Settings

Status Coloring

In order to get proper coloring of the statuses in the results, the color for the custom status should be in full Hex format. For example, don’t use “orange” as a status color, use “FF9900”.

There is no related forum thread for this, as this is just a quick update to an oldie but a goodie that I wanted to do for myself. Use this at your own risk and all that.

This entry was last updated March 5, 2009.


33 Comments

  1. 1. Dan Mall

    January 04th, 2009

    Fantastic. And I thought no human could one-up Mark Huot. Hmm, that must mean that Ryan… isn’t… human…

    (Dan runs away, screaming like a girl.)

  2. 2. Peter

    January 05th, 2009

    Looks good, those are indeed handy improvements of the original extension. Good work Ryan.

  3. 3. taggetig

    January 05th, 2009

    Great! And for me personally, it would be even better if it also could be tied to the ‘keywords’ field on the Edit page.

  4. 4. Mark Huot

    January 05th, 2009

    Ryan, I love the ability to show the entry status! A good update all around.

  5. 5. Larry

    January 23rd, 2009

    Now that it require jQuery, where might one need to stick jQuery for it to work?

  6. 6. Ryan Masuga

    January 23rd, 2009

    Larry, if you are using ExpressionEngine 1.6.5+, all you need to to is activate the extension that comes bundled in EE called “jQuery for the Control Panel” and you’ll be all set.

    Are you using a version of EE earlier than 1.6.5?

  7. 7. Larry

    January 23rd, 2009

    Ah, I had replaced my entire extensions directory when I upgraded with my old one… guess it’s a good time ot update to 1.6.7 and not make that mistake again. Thanks for the clue.

  8. 8. Markus

    February 03rd, 2009

    This seems to be a very useful addition, but it doesn’t work for me. Using EE 1.6.7, MSM 1.1, PHP 5.x, same behaviour in on two different servers and consistent with FF3 and IE7. jquery extension is enabled and the paths entered there are correct. Replaced even the extensions folder, but nothing changed. The older live search extension from Mark worked well on both servers, but with MD Live Search 1.1.9, I only see the search field, but nothing happpens if I enter any text. Any ideas on what to check?

  9. 9. Ryan Masuga

    February 03rd, 2009

    Markus: This latest version seems to not work with MSM. I’ve had a few reports of it not working and everything points to MSM. I need to do some testing with this. Sorry about the confusion.

  10. 10. Markus

    February 03rd, 2009

    Thanks for the info, Ryan. Keep us updated on any news :-)

  11. 11. Ryan

    February 10th, 2009

    Ryan,

    The download link appears to be broken - tested in FF and IE6 but no luck. I manually copied and pasted the code and uploaded, but have the same problem as Markus (I think).

    When I type any text, I notice a thin white line appear below the search box, as if the search results are trying to appear. I’m not running MSM. I stuck with the default settings and checked the upload is in the right place. I’m running EE 1.6.6 20081212. I’m going to try an upgrade to 1.6.7 but wanted to let you know.

  12. 12. Ryan Masuga

    February 10th, 2009

    I’ve noticed that Github’s download links are really hit or miss, especially in Firefox (sometimes, the third click is the charm). I’ve sometimes had to hold down “Option” to force the download. I may offer version downloads here again to avoid that problem (while keeping my work at Github for ease of development). I’m still learning Git and Github, myself.

  13. 13. Ryan

    February 10th, 2009

    Thanks Ryan. I’ll give that a try next time.

    After an upgrade to 1.6.7 I still can’t get your extension to display search results. I was testing it for an upcoming blog entry on EE extensions, but alas, can’t get the lubber to show. I’ll give it an honorable mention on screenshots alone ;)

  14. 14. Markus

    February 11th, 2009

    I can confirm that the extension is broken for me, too, in EE 1.6.7 both in MSM and non-MSM environment. So, MSM doesn’t seem to make the difference. Oh, and I had the same problems with Github in FF.

  15. 15. Ryan Masuga

    February 11th, 2009

    Wow - this is not good news. Sorry everyone!

    The only other question I have is whether or not people are using a masked control panel or not. And I should probably ask about possible extension conflicts - but maybe I should give the current version a good once over.

  16. 16. Markus

    February 11th, 2009

    Quick reply: No masked CP access here ... can’t speak about extension conflicts on the fly, would have to check that.

  17. 17. Ryan

    February 11th, 2009

    I can confirm that there are no extension conflicts - I disabled everything but Live Search and jQuery for CP, but no cigar.

  18. 18. Ryan Masuga

    February 11th, 2009

    Oh boy. Sounds like I borked this release. And that’s the beauty of Github - anyone have some spare time to fork this project and fix ‘er up? I just became a dad a few days ago and we have our hands full!

  19. 19. Eric

    February 16th, 2009

    Hey Ryan M!  Congrats on the new baby, that is the most important for sure:)  When you get back to it and are ready we will be here waiting for the fix.

  20. 20. Ryan Masuga

    February 16th, 2009

    In testing it on a site that works for me, I am finding that if I just type something quickly it may not search, but if I pause slightly between any two characters, it seems like the script catches up and will search. Definitely something a little bit amiss here, even when it’s working.

  21. 21. Karl Swedberg

    February 16th, 2009

    Hey folks,

    I’ve tried this on a couple sites and have had no problems (I’ve tested in Safari3 Mac, FF3 Mac, and IE7), so I’m wondering if maybe we can troubleshoot together here?

    For those of you who aren’t able to get this to work:
    - Do you have a number of entries already? The Live Search looks for entries (and optionally comments).
    - Are your entry fields marked as “searchable”?
    - Which browser/platform are you using?
    - Do you have the jQuery for the Control Panel extension enabled?

    Thanks.

  22. 22. Ryan Masuga

    February 16th, 2009

    What Karl said: You folks DO have searchable entries, right? I have a bazillion entries over at devot-ee.com right now. It’s running 1.6.7 and has the latest Live Search installed. It’s working fine for me there. There are some small delays (as I mentioned above) but I’m starting to think that’s due to the extra queries that have to run for each result (status, date, weblog).

  23. 23. Markus

    February 16th, 2009

    First: Congrats on the new baby!

    Jepp, I’m sure I have searchable entries - and the original Live Search by Mark Huot works on both of my sites (one with, one without MSM). So, I’ve had a closer look at my configuration - and stumbled on the following:

    EE is installed in a subdomain (ee.domain.com) and looking at the FF3 error console shows an “Access to restricted URI denied (code: 1012)” error. In detail (roughly translated, main site on www.domain.com):

    http://ee.domain.com/system/index.php?S=xxxx&C=admin&M=config_mgr&P=general_cfg is not allowed to access data from http://www.domain.com/system/extensions/ext.md_livesearch.php?ls_get_query=Test

    I don’t know why the extension tries to access the system folder through the site domain and hadn’t much luck in modifying the code either. But perhaps someone can use this info and check if his scenario is similar in case the extension isn’t working as expected?

  24. 24. Karl Swedberg

    February 17th, 2009

    Hi Markus,
    Thanks so much for investigating that! It makes sense that the script would choke with that configuration, given JavaScript’s cross-domain restrictions.

    Can you give something a try? Change line 605 in ext.md_livesearch.php to this:

    $ext_url = ‘/’.$PREFS->core_ini[‘system_folder’].’/extensions/’. MD_Ext_Filename .’?ls_get_query=’;

    Or, download the extension from my fork on Github:

    https://github.com/kswedberg/md.live_search.ee_addon/tree

    Let us know if that helps. Thanks!

  25. 25. Markus

    February 17th, 2009

    Bingo! Live searching right now ;-)

    Thanks a million!

  26. 26. Markus

    February 17th, 2009

    Okay, too early ... now search works but EE tells me “You are not authorized to post in this section” if I click on any entry. Hey, I am the superadmin - am I?

  27. 27. Markus

    February 17th, 2009

    Sorry, me again .... I can’t edit my comment above.

    New news: I can edit ... just not entries from another site in the MSM ... which pop up in the results. Seems, search isn’t honoring the site I’m switch to.

    Nontheless, a big step forward!

    Oh ... and for anyone following this thread still having problems: The above fix don’t work if you use masked CP acccess, e.g. admin.php.

    Thanks again, Karl.

  28. 28. Ryan Masuga

    February 17th, 2009

    OK, let’s clarify:

    1) Karl fixed the search issue - except when you’re using a masked control panel.
    2) The search needs to be tweaked to only search the entries for the site you’re in, if you’re in a MSM install.

    Does that sound like where we’re at with this so far?

  29. 29. Markus

    February 17th, 2009

    Ryan, exactly.

    (And sorry for the multiple posts ... I should have done testing first and posting later - will try to remember next time ;-)

  30. 30. idawgik

    February 23rd, 2009

    I found some issues with using Karl’s updated version of this extension when ExpressionEngine is installed in subdirectory instead of the site root (this is mostly for in-development sites on our setup).

    I changed line 605 to the following and that fixed it for subdomains:

    $ext_url = $PREFS->core_ini[‘site_url’].
    $PREFS->core_ini[‘system_folder’].
    ‘/extensions/’.MD_Ext_Filename .’?ls_get_query=’;

  31. 31. Ryan Masuga

    February 27th, 2009

    OK, I just made a big update to MD Live Search. Version 1.2.0 is at Github. You can read the full changelog there, but to sum up, I fixed two big things:

    1. Search has been tweaked to respect the sire you’re on in a MSM setup (Markus…can you check that?)
    2. Fixed a jQuery conflict that was arising with some of Solspace’s add-ons. If you’re interested, you can read all about it in this thread in the Solspace forums.
    3. I also took idawgik’s line for the ext_url and put it back in the extension - but commented out by default. That way if you need it, you don’t have to go hunting for it, just comment out the default line, and uncomment that line.

    I’m not sure this totally solves any masked CP issues, but I’m using a masked CP at devot:ee and the live search is working fine there.

  32. 32. Markus

    February 28th, 2009

    Ryan, everything looks great for me: On the MSM installation, only entries belonging to current site show up. Fabulous! On the other, non-MSM site, MD Live Search works without problems as well. Both use a subdomain to access the backend.

    However, when trying to use masked access the backend via admin.php on both sites, MD Live Search doesn’t display results for me. But normally, I don’t use admin.php and might have to do with my setup, so I didn’t look into detail here.

    Great work, Ryan! During testing I was even able to find some content I didn’t even know about - and that dates back to 2004 8-)

  33. 33. Ryan Masuga

    February 28th, 2009

    Markus: Glad to hear this is working (for the most part). I just tried masking the control panel in my sandbox install and it works fine.

    Maybe the combination of a masked control panel and being installed on a subdomain is just too much. You could always go in and hardcode that line to something if that would help. Sometimes it’s not a huge deal to tweak an add-on if it will help you out.

Sorry, comments are closed.