A simple extension to add a Google Custom Search to your SilverStripe template.
It allows you to add a search form to any page, which will give instant ajaxified results within 200ms or so, as well as allowing the user to go through to a more advanced search page.
Nicolaas Francken [at] sunnysideup.co.nz
see composer.json
Please contact author for more details.
Any bug reports and/or feature requests will be looked at in detail
We are also very happy to provide personalised support for this module in exchange for a small donation.
-
Find out how to add modules to SS and add module as per usual.
-
Review configs and add entries to mysite/_config/config.yml (or similar) as necessary. In the _config/ folder of this module you can usually find some examples of config options (if any).
-
add <% include GoogleSiteSearchForm %> to any of your templates
-
Make sure to run /dev/build/?flush=all
-
create / edit the GoogleCustomSearchPage in your CMS (should be created automagically).
-
to customise, you can edit / theme the following files:
- googlecustomsearch/css/GoogleCustomSearchPage.css
- replace methods and variables in the Javascript files
- theme the templates
- extend the GoogleCustomSearchPage as per usual
-
Go to https://www.google.com/cse/create/ and create your search engine
-
Select the look and feel, configure all the options
-
If you click on the "Basics" link, you will see your Search engine unique ID
-
You will also need to:
a. pay for your custom google search engine OR
b. setup a google API key (this was a real pain to do!)
- https://developers.google.com/custom-search/docs/element
- https://developers.google.com/custom-search/json-api/v1/introduction
- https://developers.google.com/custom-search/json-api/v1/using_rest
- http://developers.google.com/apis-explorer/#p/customsearch/v1/
- https://console.developers.google.com/project
- http://developers.google.com/apis-explorer/#p/customsearch/v1/search.cse.list
- https://www.google.com/cse/all
- https://www.google.com/cse/create/fromkwsetname
- https://duckduckgo.com/api