Reputation: 2269
Is there a way to easily implement accordions in Drupal 8. Till now, i've done it with field collection (or paragraph) but my client wish to can put an accordion everywhere in a content where he want. with the fields, i need prepare it on the template.
So i think on something like a shortcode known in WordPress:
[accordion]
[accordion-item id="item-1" title="Title of accordion item"]Drop-down content goes here.[/accordion-item]
[accordion-item id="item-2" title="Second accordion item"]Drop-down content goes here.[/accordion-item]
[accordion-item id="item-3" title="A Third accordion"]Drop-down content goes here.[/accordion-item]
[/accordion]
Or is there maybe some kind of a page builder module for Drupal which allows that and gives a bit more flexibility creating the content?
Thanks for any advice.
Upvotes: 0
Views: 2075
Reputation: 586
Ok so here's a very custom solution (not as easy as requested), but still, I guess I'd do it this way. You'll need FieldGroup module and theme preprocesses knowledge.
It should do the work.
Edit : You can also go with Views Accordion. But I think it would be a less interesting solution for your client UX.
Upvotes: 1