How to add pinyin to an imported Anki deck?

How to add pinyin to an imported Anki deck?

I recently switched from using Anki to Mochi for learning Chinese, but I noticed that I can’t seem to add pinyin despite it appearing in Anki.

I’ve tried to add <<Pinyin.1>> and {Pinyin.1} to the template, but it still doesn’t show up.

For example, if I write down /<<Pinyin.1>>, the only thing that will show up on the flash card is the /, but nothing else.

Is there a way to fix this problem?

The dot in the field name is what breaks it. I tried it in a test template: a field called Pinyin.1 renders empty with <<Pinyin.1>> and with << Pinyin.1 >>, while a field called pinyin works either way.

The fix is to rename the field. Open the template, go to Template fields, rename Pinyin.1 to something without a dot (pinyin1 works), then use << pinyin1 >> in the template. The pinyin that's already on your imported cards stays, because Mochi keeps field values by the field's id, not its name.

Tip: in the template editor you can press / and pick the field from the menu, so you don't have to type the placeholder by hand.