Skip to content

where are mdx fields allowed (in addition to contentField)? #995

Answered by simonswiss
stefanprobst asked this question in Q&A
Discussion options

You must be logged in to vote

Hey!

So — it's not likely that having a MDX field inside another MDX field is going to be possible. However, if you use a wrapper content component, you have access to freeform Markdown + blocks inside that field. Paired with a repeating component, you could achieve what you want nicely.

So in your example, the Quizz component could be turned into a repeating component instead of block. The question would be part of the schema for the repeating component, and for the children array you'd allow the Answer component.

Then, you'd create an Answer component which is a wrapper component, with an empty schema. You can write the answer with MDX inside the wrapper component, and add as many answe…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@stefanprobst
Comment options

@simonswiss
Comment options

@stefanprobst
Comment options

@simonswiss
Comment options

Answer selected by simonswiss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants