Adding a Template

Templates let you define a consistent structure for the cards in a deck. Instead of building each card from scratch, you can create a template once and then fill in the blanks for each individual card.

Create a template

Let's walk through creating a simple template for our deck. We'll reuse the layout we created in the previous section.

  1. Open the deck where the card from the last section was created.
  2. Click on the Add Template button at the top of the page.
  3. Click New template and give it a name (like "My template").
  4. Copy and paste the contents from the card we created earlier.

     # What is Mochi?
     ---
     An app that helps you **remember** things.
    
  5. Select the text What is Mochi? (not including the hash # symbol) and replace it with <<Front>>.

  6. Select the text An app that helps you **remember** things. and replace it with <<Back>>.
  7. Click on the Name field and rename it to "Front".
  8. Click New field and name it "Back".
  9. Close the template window.

Your deck now has a reusable template ready to go. Every new card that is created in this deck will, by default, have this template applied. Previously created cards will not be affected.

Using the template

Back on the deck screen let's use our new template by creating a new card.

  1. Click New Card.
  2. Fill in the Front field with the follwing text:

    What is the capital of France?
    
  3. Fill in the Back field with the following text:

    Paris.
    
  4. Click Save.

Our card will render the markdown defined in the template, replacing the <<Front>> placeholder with the text from the Front field, and the <<Back>> placeholder with the text from the Back field.

To learn more about placeholders, fields, and how templates work in general, check out the Templates section.