Twitter: thinking of retiring my 5 year old hp laserjet 1012 and springing for something wireless [...]

How To: Make a Firefox Search Plugin for a WP Site

Sep 20, 2006 in , ,

After 9rules released their comprehensive new search feature on Monday, allowing users to search member content and receive results from Flickr, YouTube and Technorati, it was only a matter of time before someone created a Firefox search plugin. This got me thinking that it would be pretty cool if PaulStamatiou.com readers could have that same convenience. Well now you can, and I’m going to show you how to make one for your WordPress-powered blog as well.

The Mycroft site, which stores a repository of Firefox search plugins, has a basic outline of how to make a working plugin. However, to get it working with WordPress you will need to change a few items. First off, every search plugin has two parts: the source file, which is converted to XML once you upload it to Mycroft, and search image. I’m not sure what image file types the search plugin can take but it seems to work well with GIF’s and PNG’s. Both of these files must be named the same, with the exception of the file type. For example, my files are named PSsearch.gif and PSsearch.src.

The main thing that needed to be changed for WordPress compatibility was the search query which goes by index.php?s= instead of using query. Below is the code I changed from the Mycroft tutorial; the rest of it stayed the same.

<search version=“7.1″
 name=“PaulStamatiou.com Search”
 description=“PaulStamatiou.com - Tech News/Reviews/Guides”
 action=“http://paulstamatiou.com/index.php”
 searchForm=“http://paulstamatiou.com/index.php”
 method=“GET”
 >

<input name=“sourceid” value=“Mozilla-search”/> /* for some reason WordPress insists on putting the ending slashes */
<input name=“s” user/>

<browser update=“http://mycroft.mozdev.org/update.php/id0/PSsearch.src”
 updateIcon=“http://mycroft.mozdev.org/update.php/id0/PSsearch.gif”
 updateCheckDays=“7″
>

When you’re done with that, submit your plugin with this tool. Once everything is uploaded, do a quick search on Mycroft to find your plugin and install it. That being said, go ahead and try out my search plugin. I decided to convert my site’s favicon and use it with the search plugin for consistency. Overall I think it turned out quite well for something that took me a few minutes of work. A great addition to any blog.

PaulStamatiou.com Search

Alternatively, you can host the search plugin on your site using JavaScript and a properly constructed link as done on UNEASYsilence in the sidebar.

Promote this article on various sites or email to your friends:     



20 Comments

  1. I just tested it and it seems to work in Flock as well.

  2. Great tutorial, Paul. Too bad I couldn’t have used it for the 9rules Search plugin. I had to go through Mozilla’s horribly confusing documentation on how to create a plugin. Oh well, if I wouldn’t have suffered through creating the plugin, this tutorial wouldn’t exist. At least future search plugin creators can enjoy the simplicity of your tutorial.

  3. Thanks for even giving me the idea to make one. =)

  4. Hey guys, if you’re looking for a more in-depth tutorial on how to write these things from scratch, I put together a long tutorial over at BusinessLogs.com back in February 2005 that talks about the ins and outs, code, XML, the whole enchilada.

  5. Might have to link back to this - Thanks for the nod!

  6. For the less coordianted among us, there is a good plugin for all this here

  7. Paul - as always you rock! I’ll be making one for my site later today. Thanks!

  8. Paul, you made it on TUAW twice in one week, nice!

  9. Do these work for Flock too, or is there an extra step to make them compatible? And what about Firefox 2.0? Are there any compatibility issues there?

  10. Thats cool info man i would love to play with it.Make some search site tool for our college website.

  11. Thanks for the tip,

    I prefer Quick Search on Firefox rather than the search box

  12. Wow, thanks for this nice simple explanation. I gave up looking through the Firefox /Mozilla page on plugin development. This is great. I’m going to give it a try for my Level1Diet site, which has almost a million pages.

    By the way, I created an XML version to search my big online database in MSIE 7.0 with their tool that adds a search. Seems to work fine in Explorer 7.0 (but not for earlier versions of course). Can it work in Firefox, with some modification?

  1. [...] You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your ownsite. [...]

  2. Bitacle Blog Search Archive - How To: Make a Firefox Search Plugin for a WP Site…

    [...] After 9rules released their comprehensive new search feature on Monday, allowing users to search member content and receive results from Flickr. [...]…

  3. [...] I came across this Post and wanted to share it. It can come in handy if you wanted to search a particular site instead of going through a search engine. Check it out works like a charm! Explore posts in the same categories: Programming, For Fun [...]

  4. [...] (Thanks: Paul Stamatiou)  Home | Permalink |  [...]

  5. [...] After reading Pauls’ Stamatiou article on How to make a Firefox search plugin for a wordpress site, I’ve decided to make one for this site. So here you go. The link bellow should install it for you. If it doesn’t work let me know and I will try and fix it. Or you can use the Mycroft Mozdev.org Search Page. [...]

  6. [...] Ein weiterer Schritt zur Weltherrschaft der Affen ist vollbracht. Das Affenheimtheater hat seit gestern ein eigenes Suchmaschinen Plugin für Firefox, mit dem ein freundlicher Affen schnell und einfach das komplette Blog für euch durchsucht. Zur Installation einfach auf die Grafik klicken und auf der Ergebnisseite das untere Plugin (heute aktualisiert) wählen. Wer für sein eigenes (Wordpress) Blog eine Suchplugin haben möchte, findet hier ein entsprechendes How To. Auf der Mindzilla Seite gibt es einen Validator, mit dem ihr den Quellcode vor dem Veröffentlichen überprüfen könnt. [...]

  7. [...] Siguiendo los pasos de la web de Mycroft y la modificación que sugieren aquí me ha resultado muy sencillo crear este plugin de búsqueda para Firefox. Dudo que le interese a alguien más, pero de todas maneras puede instalarlo quien quiera. [...]

  8. [...] How To: Make a Firefox Search Plugin for a WP Site - PaulStamatiou.com Same code can be used for non WP blog sites as well. Just don’t put a trailing slash for input tags. (tags: wordpress firefox search plugin) [...]

Post a comment, receive Stammy points.


Send a trackback.


  • If you plan on posting code, run it through Postable first.
Copyright © 2005 - 2008 PaulStamatiou.com  Privacy Policy - Terms of Service Can't spell my name? Use PSTAM.com. Go back up ↑.