How to add a collections-only search field to a specific page?

I would like to add a search field to a blank page that doesn’t replace site-wide search in the main nav, where this page-specific search field allows users to search just the names of collections, and have the search results returned where those collections’ names match the search word(s). I do not want products returned in the search results at all — only collections whose names have a keyword match to the search term(s).

Does anyone know of a way or an app that will do this?

Nevermind. I figured out how to do this for myself using JSON from the collections list page, a search field, CSS, and javascript.

Would you mind sharing the details of your solution? Thanks.

This is the code I created to search all collections. It’s “hacky” but so is EVERYTHING with Shopify. I guess that’s why I’m no longer using it.

Don’t forget to replace {yourwebsite.com} in line 89 and 109

Anyway, hope this helps…


  

Note: search begins after you enter three characters