Content dependent card (quantity) generation

You can do this with clozes. Put the :smiley: into the “Front” field, and format the “Back” field with clozes as follows:

{{c1::}} {{c2::smile}} {{c3::happy}} {{c4::cheerful}}

(the first cloze is empty and serves as a placeholder for generating the single Front → Back card)

On the front template, use:

{{#c1}}
{{Front}}
{{/c1}}

{{^c1}}
{{cloze:Back}}
{{/c1}}

(this will show the content of the Front field on the first card, and the clozed Back on all subsequent cards)

Add the following to the Styling to hide all not clozed parts from the subsequent cards and to uncloze the clozed part:

.cloze-inactive {
	display:none;
}
.cloze {
	font-size: 0px;
}
.cloze::before {
	content: attr(data-cloze);
	font-size: 20px;
}

Similarly, on the back template, show either full content of the Back field or Front depending on the ordinal number of a card:

{{#c1}}
{{text:cloze:Back}}
{{/c1}}

{{^c1}}
{{Front}}
{{/c1}}
5 Likes