Fields visible when editing but not visible in answer

I downloaded this deck from the following online (link below) and am unable to have the field with the conjugations display when doing reviews. The text is present when viewing “field editor” and the section is present on “card format” editor.

If I hit “preview” on the individual card (mobile or desktop- on iOs), the field with conjugations will display on the card and future reviews.

I have attached the HTML. I would like for the conjugation to be shown on all cards when doing reviews.

Thank you all

——————————————————————————————————————————


Deck location: link can not be attached, google “I’m rereleasing my Russian Anki deck with 25k cards

HTML:

<div class="headword">{{Imperfective}}</div>

<div class='content' id='impf'><b>несовр.: </b>{{Imperfective_Stress}}<br></div>

{{#Perfective_Stress}}
<div class='content' id='pf'><b>совр.: </b>{{Perfective_Stress}}<br></div>
{{/Perfective_Stress}}

<script>
  const fixConjugation = function(id, string) {
    const conjugations = string.split(",");
    let final = ""
    for (let i = 0; i < conjugations.length; i++) {
      if (i == conjugations.length-1) {
        final = final + conjugations[i];
      } else {
        final = final + conjugations[i] + ", ";
      }
    }
    const element = document.getElementById(id)
    if (!element) return
    const current = element.innerHTML
    element.innerHTML = current + final;
  }

  fixConjugation('impf',"{{Imperfective_Conj}}")
  fixConjugation('pf',"{{Perfective_Conj}}")
</script>

{{Audio}}

<div class="content">
  <a href="http://en.wiktionary.org/wiki/{{Imperfective}}#Russian">Wiktionary</a>
</div>

<div class="content">
  <div class="tabs">
    <input name="tabs" type="radio" id="tab-1" checked="checked" class="input"/>
    <label for="tab-1" class="label">русский</label>
    <div class="panel">
      {{Ru_Meaning}}
    </div>

    <input name="tabs" type="radio" id="tab-2" class="input"/>
    <label for="tab-2" class="label">английский</label>
    <div class="panel">
      {{En_Meaning}}
    </div>
  </div>
</div>

  • Is what you posted the front template, or the back template?
  • What is the exact name of the field (capitalization matters) that you want to appear on the card?
  • Since this appears to be a template issue, have you contacted the deck author for a fix?
1 Like

I did make it work; I changed the var to a single function.

Paste this into your template:

<div class="headword">{{Imperfective}}</div>

<div class='content' id='impf'><b>несовр.: </b>{{Imperfective_Stress}}<br></div>

{{#Perfective_Stress}}
<div class='content' id='pf'><b>совр.: </b>{{Perfective_Stress}}<br></div>
{{/Perfective_Stress}}

<script>
function fixConjugation (id, string) {
    var conjugations = string.split(",");
    let final = ""
    for (let i = 0; i < conjugations.length; i++) {
      if (i == conjugations.length-1) {
        final = final + conjugations[i];
      } else {
        final = final + conjugations[i] + ", ";
      }
    }
    var element = document.getElementById(id)
    if (!element) return
    var current = element.innerHTML
    element.innerHTML = current + final;
  }

  fixConjugation('impf',"{{Imperfective_Conj}}")
  fixConjugation('pf',"{{Perfective_Conj}}")
</script>

{{Audio}}

<div class="content">
  <a href="http://en.wiktionary.org/wiki/{{Imperfective}}#Russian">Wiktionary</a>
</div>

<div class="content">
  <div class="tabs">
    <input name="tabs" type="radio" id="tab-1" checked="checked" class="input"/>
    <label for="tab-1" class="label">русский</label>
    <div class="panel">
      {{Ru_Meaning}}
    </div>

    <input name="tabs" type="radio" id="tab-2" class="input"/>
    <label for="tab-2" class="label">английский</label>
    <div class="panel">
      {{En_Meaning}}
    </div>
  </div>
</div>

Let me know, if it works for you.

1 Like

@Danika Thank you for your help but @Duude solved it.

@Duude. I am very appreciative of this. This will really help me. Have a nice day and thanks for helping me out, truly grateful :slight_smile:

2 Likes

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