Join the Webstudio community

Updated 2 months ago

Populating accordion elements with data from a collection

At a glance

The community member is trying to populate Accordion elements with data from a collection, such as FAQs obtained from the backend. They are facing issues where connecting a collection breaks the accordion functionality, and nesting is limited. Alternatively, placing an accordion in a collection element results in unconnected accordions that do not work correctly.

The comments suggest that the community member should set a unique "value" from the data on the accordion item, which could be the "title" if no alternative is available. This would allow the accordion to identify the specific dynamic item.

The community member acknowledges this suggestion and confirms that it solved their issue, stating "now it works!".

Hello!

Does anyone know how to populate Accordion elements with data from a collection? e.g. FAQ obtained from the backend.

Connecting a collection breaks the work of the accordion, there seems to be limited nesting.

Or I can place an accordion in a collection element, but then it is a lot of unconnected accordions on one element and then it also works incorrectly.
B
a
6 comments
Did you set unique "value" from data on accordion item?
Attachment
image.png
yes I tried to set it on accordion or items, but i had an error

it expects string not json
Attachment
Screenshot_2024-09-25_at_12.20.34.png
I mean value should get some unique string from collection item
Could be "title" if no alternative
it will let accordion to identify specific dynamic item
Oh, thank you very much! yes this seems to be what I was looking for and could not think of it!!! now it works!
Add a reply
Sign up and join the conversation on Discord