Special field: {{Card}} variable does not return the card name/number in Cloze note types`

When using the {{Card}} variable in Cloze note types, it always outputs the static text “Cloze”, instead of showing the actual card type name + number (e.g., “Cloze 1”, “Cloze 2”, etc.)

This behavior does not occur in Basic or other note types — it seems to be specific to Cloze notes.

Please make the {{Card}} variable return the full card name (e.g., “Card 1”) or provide a new variable (like {{CardNumber}}) that works correctly in Cloze note types.

1 Like

Cloze is the name of the card type/template – which is what that special field replacement is meant to return.
image

In terms of what you want to have change about that – can you explain more about your use case? The only thing more you’d get from the “number” is the same as the cloze-marker that matches the deletion for that card – so it seems like you already have that.

2 Likes

Thank you for clarifying!

My use case is that I’d like to automatically play a specific audio field when revealing each cloze card.
For example, if the note generates seven cloze cards, I have seven audio fields (Audio1Audio7), and I’d like to automatically play the one that matches the cloze deletion currently shown.

Since {{Card}} returns only the template name “Cloze” and not the cloze number, there’s currently no way to dynamically determine which cloze is being shown inside the template.

Would it be possible to expose a variable such as {{ClozeNumber}} or {{ClozeIndex}} that returns the number of the current cloze deletion?

That would make it possible to build interactive cards that sync specific media or behavior to the revealed cloze.

{{#c1}}
{{Audio1}}
{{/c1}}

{{#c2}}
{{Audio2}}
{{/c2}}

{{#cn}}
{{Audion}}
{{/cn}}

4 Likes