Radio / Select with no predefined values?

Hello,

I’m new to Contentful and I’ll use the CMS will to create something quite similar to a school exam:
A program containing sessions containing questions.

Some question will be designed as radio buttons.
My goal is to allow the content creator to use a content type question and add the values he wants for the radio button on the fly.

It seems that I can’t create a radio button with no predefined values?
Is that correct?

It seems heavy to have a different type of content for the lists of options and create one for each of them.

Any pointer on how I could achieve what I’m looking for would be greatly appreciated.

Hey Amaury!

Welcome to the community. The best place for you to find answers would be our Slack channel. http://www.contentful.com/Slack It is far more active and you will get an answer much quicker!

The radio button appearance in Contentful is used to show the content creator a list of possible choices of which they can only choose one.

I believe what you are talking about is showing the visitor to your website the question and a list of possible choices. What you want to show the content creator is the ability to freeform input that list of possible choices, right?

To do that you could create a content type called Radio Button Question or something similar which would have these fields:

  • Internal Name - short text
  • Question - short text or long text
  • Choices - short text list

This will allow the content creator to add a Radio Button Question to a Session and input the question to be shown and then freely add as many Choices as desired.

One note - the short text list field has max length of 256 characters for each item in the list. If you want to allow your content creator to have a choice that is longer than 256 characters then you should do what you mentioned as “too heavy” - use a reference field for the Choices field, create a separate content type called Radio Button Choice with an Internal name short text field and a Choice long text field, and restrict the Choices reference field to only be able to choose entries of the Radio Button Choice field. As long as you are okay with the 256 max length restriction per choice for the choices field then you shouldn’t need to do this.