Multi-engine site search
I added the /search page to the site with a form supporting multiple search engines. The hope is to give visitors a bit more choice in what companies to interact with.
The challenge was managing different query param for different sites.
- DuckDuckGo doesn’t support multiple
q=
params, but does acceptsites=
- Ecosia doesn’t support a
sites=
param but does support multipleq=
params (albeit with an extra comma requiring a space) - Google does support a
as_sitesearch=
param but that was dropped with the addition of anotherq=
param.
By adding several different hidden form fields, I was able to cover each engine (almost) seamlessly. Then the only difference was the form action would could be defined on the button. The final result is as follows:
<form rel="search" method="get">
<input type="hidden" name="sites" value="ciccarello.me"/>
<input type="hidden" name="q" value="site:ciccarello.me "/>
<input type="text" name="q" placeholder="Search"/>
<button type="submit" formaction="https://ecosia.com/search">Search with Ecosia</button>
<button type="submit" formaction="https://www.google.com/search">Search with Google</button>
<button type="submit" formaction="https://duckduckgo.com/">Search with DuckDuckGo</button>
</form>
Responses
See how to respond...
Respond via email
If you'd prefer to message me directly, send an email. If you'd also like your message to be visible on the site I can add it as a comment.
Reply via Email
Respond from another site
Responses are collected from posts on other sites. Have you posted somewhere that links to this page? If so, share the link!