Conditional Replacement not working

Hello folks,

I am creating a custom template with the following fields:

  1. English
  2. Noun/Verb/Adjective
  3. Other Word Classes
  4. Sentence
  5. Grammatical function
  6. Pronunciation
  7. Picture
  8. Chinese
  9. Inflection
  10. Notes
  11. Source

Out of those fields, I want to create different cards depending on which fields are filled with text. For instance, Card type number 2, called “Comprehension Other”, creates cards for all those cards that depict neither Noun/Verb/Adjective nor a Sentence (e.g. a conjunction like “and”). For this reason, it is only supposed to create this card if the field “Other Word Classes” is filled with content. To that end, I have programmed the front of the template as follows:

{{#Other Word Classes}}

{{Other Word Classes}}{{Pronunciation}}
{{Grammatical function}}

{{Picture}}

{{/Other Word Classes}}

However, instead of not creating the card in the first place, it does create the card, displaying the message “The Front of this card is blank”. The issue is that I only want this card type to be created if and only if the Field “Other Word Classes” is actually filled with something. I don’t understand why the conditional replacements are not working. Does anybody know what I’m doing wrong?

Thanks in advance for your help!

Don’t worry, the cards were created as you expected.

In the card template editor dialog - which you open from Cards… in the card browser - the preview shows what the template would display for the card you have selected in the card browser. So, the card/note you had selected at that time must’ve been one for which the Other Word Classes field was empty. If you select a different card/note that does have that field filled in and then open the template editor from Cards… the preview would show the front.

Also, if you have the browser in the cards mode and enable the Card column, you’ll only see Comprehension Other cards for those notes that have a non-empty Other Word Classes.

2 Likes

H jhhr,

The issue got resolved, thank you very much for your help!

Cheers,

LAAR

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.