I would like to create a search box component, similar to the one that comes out of the box with CQ5. But I’d like it to have the following features:
- AJAX search (this would mean that the entire page wouldn’t need to refresh on submit)
- Auto-suggest (I’d like the admin to be able to choose an excel spreadsheet with the auto-suggest words)
- Ability to specify one folder to search (this is already a feature in the existing search)
I was thinking of using a free jquery plugin to provide the ajax and auto-suggest features, but I’m new to CQ5, so still figuring out what’s possible.
- Is it a good idea to use a jQuery plugin as a starting point?
- Once I’ve developed the jQuery, what would I need to do to integrate that into a CQ5 component?
- Before I start, is there some way to download or buy a search component for CQ5 that already has some or all of the above features?
Please forgive my noob questions!
Many thanks,
Katie
Sure, jQuery plugins can work. I would start by copying the existing CQ search component at /libs/foundation/components/search and extend the search.result class. The clientlibs folder will contain your JS and the plugin. See this post for a good discussion of clientlibs: http://blogs.adobe.com/livecycle/2012/02/cq5-clientlib-explained-by-example.html