Hi guys,
Once upon a time we created a frequently asked questions module for a customer.
We had made a page template with some placeholders which each represent a category.
On this page you can place paragraph item types of the type Faq which have a question field, an answer, etc.
You could place these paragrpahs in the corresponding placeholder and sort it by drag and drop.
The paragraph template shows an accordion, so the page is a list of accordions and has a bit of javascript for interaction ...
This has worked perfectly for some time now.
Now there has been a new feature request, to be able to search in these faqs.
A search box on the top of the page and when searching the paragraphs that have a mach should stay on the page and the rest have to be removed from the DOM.
I tried the search model, set to search on this page specificly (and underlying pages), which does work, it recognizes the paragraphs.
But this is made for page search and there doesnt seem to be a way to get something like paragraph ids to be able to use these ...
I tried creating a query on the contentindex and use the search term as parameter, but the querypublisher never gets my faq items as a result.
Probably not made for paragraphs either ...
Is there a way, even if it's a nasty hacky kind of way, to search paragraphs of a certain type (faq) on some fields (question, answer) and get their id's to manipulate the dom with javascript?