Rendering dynamically-sized lists / arrays #834
-
I read the docs on rendering arrays in For example, say I want to have an FAQ component in my CMS, and want to be able to add new questions and answers as needed. In that case, using the approach described in the docs wouldn't work, as far as I can tell. Is there a workaround for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Can you provide an example of how the CMS output looks like? From my experience a CMS might allow to add a custom FAQ type (see custom types in Prismic for example) that can then be used on a content page to add multiple items, possibly depending on a locale (locales in Prismic). So from my understanding, On a related note, you can use rich text formatting to some degree for rendering lists of unknown size: "list": "<FaqItem><FaqTitle>First title</FaqTitle><FaqDescription>First description</FaqDescription></FaqItem><FaqItem><FaqTitle>Second title</FaqTitle><FaqDescription>Second description</FaqDescription></FaqItem>" It's a bit tedious to edit for translators though, so a first-class feature in a CMS might be the better fit. Hope this helps! |
Beta Was this translation helpful? Give feedback.
Can you provide an example of how the CMS output looks like?
From my experience a CMS might allow to add a custom FAQ type (see custom types in Prismic for example) that can then be used on a content page to add multiple items, possibly depending on a locale (locales in Prismic).
So from my understanding,
next-intl
shouldn't be necessary in this case.On a related note, you can use rich text formatting to some degree for rendering lists of unknown size: