Skip to content

Instantly share code, notes, and snippets.

@carlosescri
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlosescri/0ed26444524ad5a6a138 to your computer and use it in GitHub Desktop.
Save carlosescri/0ed26444524ad5a6a138 to your computer and use it in GitHub Desktop.
Use `doofinder_script.html` if your website has its own search box. If not, configure your Doofinder layer based on `doofinder_script_alt.html` (this version of the script will automatically create a search box for you at the top of the page). You will find the search engine ID in the Doofinder control panel. Go to "My Account > Search Engines".
<!-- START OF DOOFINDER SCRIPT -->
<script type="text/javascript">
var doofinder_script = '//cdn.doofinder.com/media/js/doofinder-4.latest.min.js';
(function(d,t){var f=d.createElement(t),s=d.getElementsByTagName(t)[0];f.async=1;
f.src=('https:'==location.protocol?'https:':'http:')+doofinder_script;
s.parentNode.insertBefore(f,s)}(document,'script')
);
if(!doofinder){var doofinder={};}
// More options: http://www.doofinder.com/developer/doofinder-layer
doofinder.options = {
lang: "en", // Change to "es", "fr", "de", ... a language 2-letter ISO code
results: {
width: 600,
defaultTemplate: "GridView"
},
header: {},
queryInput: "#searchbox", // change to a jQuery-style CSS selector that matches your search box
hashid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" // Your search engine id
};
</script>
<!-- END OF DOOFINDER SCRIPT -->
<!-- START OF DOOFINDER SCRIPT -->
<script type="text/javascript">
var doofinder_script = '//cdn.doofinder.com/media/js/doofinder-4.latest.min.js';
(function(d,t){var f=d.createElement(t),s=d.getElementsByTagName(t)[0];f.async=1;
f.src=('https:'==location.protocol?'https:':'http:')+doofinder_script;
s.parentNode.insertBefore(f,s)}(document,'script')
);
if(!doofinder){var doofinder={};}
// More options: http://www.doofinder.com/developer/doofinder-layer
doofinder.options = {
lang: "en", // Change to "es", "fr", "de", ... a language 2-letter ISO code
results: {
width: 600,
defaultTemplate: "GridView"
},
header: {},
hashid: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", // Your search engine id
searchBox: {
// More searchBox options: http://www.doofinder.com/developer/doofinder-layer#search-box-options
position: "center"
}
};
</script>
<!-- END OF DOOFINDER SCRIPT -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment