FOLLOW USJoomlashack FacebookJoomlashack TwitterJoomlashack Google +Joomlashack RSS

Joomlashack logo blog
Published on 18 May 2007

How to add OpenSearch to your Joomla website

I found a story on Digg today which sounded interesting. If you use Firefox 2 or Internet Explorer 7 then you'll notice a litle search bar at the top of your window which looks something like this. The way to achieve this is so simple. You can read more into it here or just follow along to get it working in Joomla!

FF2opensearch 

I found a story on Digg today which sounded interesting. If you use Firefox 2 or Internet Explorer 7 then you'll notice a litle search bar at the top of your window which looks something like this. The way to achieve this is so simple. You can read more into it here or just follow along to get it working in Joomla!

At first glance you may think this is a some hack job into the Google search API or your browser mainframe but looking a little deeper, you can see this little site is hosted by on the a9 servers which is none other than Amazon so I can be pretty safe by assuming this is a solid add-on to websites with a good amount of content. Surely, you can expect to see this more and more around the web.

How to do it:

All you need to do is copy and paste the following text into a blank text file and name it opensearch.xml.  

<opensearchdescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<shortname>[SITE NAME]</shortname>

<description>Use Google to search [SITE NAME]</description>

<tags>[SITE HOST]</tags>

<url type="text/html" template="http://www.google.com/search?q=site:[SITE HOST]{searchTerms}"></url></opensearchdescription>

Replace [SITE NAME] with your title and and [SITE HOST] with your main domain URL and just upload it to your web server root. The next step is to open your template's index.php file and add this bit of text anywhere inside the <head></head> tags.

<link rel="search" href="/http://www.YOURDOMAIN.COM/opensearch.xml"
type="application/opensearchdescription+xml"
title="YOUR SEARCH TITLE" />

Thats it! You're done.

This is only a feature of IE7 and Firefox 2 so if you're using IE6 or an older version of Firefox, you won't be able to see it, but give it some time and it'll surely be of good use to someone. I'm hoping users will use it to search our forums a little closer for existing answers :)

 

 

published in Joomla How To

RECENT POSTS

  • RT@sarahwatz: What you do with your customer data? Are you using it efficiently to service and target your customers? http://t.co/i7yi1CsUcc

    about 1 day ago