Most efficient way to make exact same dropdown on back and front of card?

Hey all, I’m not proficient in html but managed to copy/paste enough off the forum to create a

dropdown on my flashcards. I would like to include the exact same text and dropdown on the front and back of my cards. Is there another way to do this than copy/pasting the entirety of the html on the front and back of every card? There’s got to be a way to pull the portion of my html dealing with the dropdown and call it in the back field or incorporate it into the template. Neither of which I have been able to figure out with sufficient googling and research before posting.

For context, I am learning Chinese and want to include a dropdown for the pronunciation of the characters, called ‘pinyin,’ on both sides of the flashcard. That way, when Anki creates reversed cards I can reference the pinyin with the English translation and practice writing the characters without seeing them, and drill the Chinese characters but have the pinyin there as reference should I forget how to pronounce the word(s).

Here is an example card I’m using to do this:

front html field entry:

你好
<br>
<br>
<details style="font-size: 50%;">    
<summary>Pinyin</summary>    
Nǐ hǎo  
</details> 

back field:

Hello
<br>
<br>
<details style="font-size: 50%;">    
<summary>Pinyin</summary>    
Nǐ hǎo  
</details> 

Is there any way to incorporate this into the template of the card-type too? I figure that may fix me having to paste it in either field regardless. Any help is greatly appreciated as I get my bearings. Thank you.

1 Like

Front Template

{{field1}}
<br>
<br>
<details style="font-size: 50%;">    
<summary>Pinyin</summary>    
{{field2}}
</details> 

Back Template

{{field3}}
<br>
<br>
<details style="font-size: 50%;">    
<summary>Pinyin</summary>    
{{field2}}
</details> 
1 Like

Is there a reason you’re not using Hint Fields for this? It seems much simpler. Field Replacements - Anki Manual

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