Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Open Search Descriptions For Browser


majika

Recommended Posts

Posted

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 competitions 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>[email protected]</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 for my advanced_search.php page (Using Method 1 - The Text Version)

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

 

Now the above code uses a text <a> link but I want to use an image as the link fo users to add the search to the site

 

Can Someone help me do this please ?

 

Does this work with PHP?

 

Are there any Contributions ?

 

Kindest Regards To Anyone who help :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...