brinch
brinch

Reputation: 2614

In Umbraco, how to repeat block of properties multiple times in document type?

In Umbraco I have a document type (A) which I would like to contain one or more quizzes. A quiz contains these properties:

Quiz number
Quiz question
Quiz option #1
Quiz option #2
Quiz option #3
Quiz correct option

As I don't know beforehand how many quizzes there will be on the page, I figured I would move the quiz properties to a document type of it's own (B), and then use that as a composition on A.

But it seems that using composition, I can only have one instance of B. How can I have the quiz repeated 1-n times as needed on A?

Upvotes: 0

Views: 219

Answers (1)

wingyip
wingyip

Reputation: 3536

Doc type B should not be a composition, it should be used for content nodes that are children of A.
You could also use Nested Content as Jannik suggests. Basically, you use B as your nested content doctype that can be repeated on your content node as many times as you like.

Upvotes: 2

Related Questions