There are a couple of ways to peel this, and without going in to detail which you'll find in various other posts or RTFM pages:
1. If you want to contain the content for your accordion to a single resource, use MIGx with a single TV that will allow you to add multiple 'rows' to your TV. Render this using chunks (tpl) that generate the require HTML structure for your accordion.
2. If each row in your accordion can be considered a resource in its own right, hang these child resources off a parent page which contains a getResources call - again, rendering using chunks (tpl) that generate the required HTML structure.
Which method you choose depends on the nature of the content in your accordion, how a content editor would expect it to be structured etc.
[ed. note: wallacio last edited this post 11 years ago.]
-
☆ A M B ☆
- 24,524 Posts
If there's likely to be a lot of these, and they each contain a lot of content, you can even use MIGXdb to create a grid TV like solution #1 above, but using a separate database table for the items.
You can also use MIGXdb in a single TV to
generate a grid based on resources. Functionality would be like #2 above, but the convenience of management would be the same as #1.
MIGX comes with several snippets for the output of its grid TVs. Usually the getImageList snippet is sufficient.