Jump to content
Sign in to follow this  
majika

Open Search Descriptor.xml

Recommended Posts

Hello, Before I begin I thought this would be the most relevant forum to post my query into [MODS PLEASE MOVE IF NOT]

 

First off, This is not a contribution of any kind this is just a contribution to my own shop :)... So I guess we could argue the relevance of where this post should/should not be in !

 

What I am trying to achieve with small success is the implementation of the Open Search Descriptor XML Standard for browsers which will be offer search functionality from my eShop other members whilst searching the compititions site or from anywhere on my site or any application that runs the browser it is installed into.

 

OVERVIEW

For a perfect idea of what I am trying to achieve is a button that when clicked will allow customers/members to add my eShops Search facilities to their browsers like IE7 and FFox 2 etc

 

Check out this page for what Microsoft has done http://www.microsoft.com/windows/ie/search...m/runonce2.aspx

 

 

The standard Open Description standard is pretty straight forward, check it out it's only a quick 20min read of the overview Open Search Description Spec. 1.1 everything in there is self explanatory.

 

Now for the small problem of implementation on my site:

 

I have decided to start small and then add the service to other relevant pages that are most relevant to users who are searching for a item/product. Therefore a good place to add the search service link/button is on my home page - This is for the benefits of helping with the code that you may be able to help me out with:

 

"https://www.mydomain.co.uk/shop/index.php"

 

The second page I would like to add the Open Search Service to customers to is in the advanced_search.php

 

"https://www.mydomain.co.uk/shop/advanced_search.php"

 

Plus a couple of other relevant places, but once I got the first one right the rest will follow. (I Hope :)

 

METHODS FOR ACHIEVING THIS

 

Now there are two methods of doing this that I can see that are fiesable and do not send my visitors off in a hurry...

 

The first Method: - This will Offer a "BUTTON" that, once clicked triggers the code that adds the Search Functionality to the users Browser

 

Method Two: - I could include some basic Link data in the <HEAD> element of the page to automatically Pop-up a request box that says something along the lines of:

 

 "ADD SEARCH PROVIDER"
The following search provider is already installed Do you want to replace it?

NAME:	 "Search me"
FROM:	 "www.domain-name.co.uk"

Blah! Blah! Blah!

|YES| |  |NO|

 

Fictitious but working opensearch.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
- <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
 <ShortName>Search me (16 Chars Max)</ShortName>
 <Description>Search our Website from your Browser Without being on our webpage(1024 Chars Max)</Description>
  <Tags>example web</Tags>
  <Contact>admin@domain-name.co.uk</Contact>
	  <InputEncoding>UTF-8</InputEncoding>
	  <Url type="text/html" template="http://www.domain-name.co.uk/shop/advanced_search_result.php?keywords={searchTerms}&x=10&y=9" />
 </OpenSearchDescription>

 

Now the above is just an illustration of the code snippet not the actual url,description or short name tags. This is stored in my root folder of my /search/ Sub-Domain.

 

 http://search.domain-name.co.uk/opensearch.xml

 

Inserting this into the page

 

This is a snippet from my advanced_search.php page (Using Method 1 - The Button Version)

<table>
<tr>
  <td>
  <a href="#" onClick="window.external.AddSearchProvider('http://search.sellitor-sales.co.uk/opensearch.xml')"
>

  </a>
</td>
</tr>
</table>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×