Templates
Getting Started
To get started with your first template, open an empty daily or regular (project) note and you will see an "Insert Template" button on iOS and Mac which opens a context menu with the available templates. If you have no templates yet, NotePlan will suggest you create a few samples.
You can see the list of available templates in the new "Templates" folder in the sidebar under "Smart Folders". That's where you can also create new templates or edit/delete existing ones:
To insert templates into existing notes, see here.
You can also select a template to be auto-inserted. Read more about this here.
Template Structure
A template consists of two parts:
- Frontmatter (optional) = metadata like title, type, and other information
- Body = future note content using placeholder tags
Frontmatter
Frontmatter is the metadata of your template and it's located at the top between a starting and ending "---" (three dashes, displayed as a blue line in NotePlan).
It's optional but recommended because here you can define the title and type of the template. For example, the type empty-note
will make the template appear as an option for empty notes (when you click on the "Insert Template" button). And the type meeting-note
tells NotePlan to show this template as an option for creating meeting notes.
All template types:
empty-note
= Shows the template as an option in empty notes (when you click on the "Insert Template" button).meeting-note
= Shows the template as an option in meeting notes (right-click / long-press an event for example).calendar-note
= Shows the template only in (daily) calendar notes (available in v3.5.2).project-note
= Shows the template only in (regular) project notes (available in v3.5.2).
Tags
You can use various tags in templates to display dynamic information in your notes from something as simple as printing a date & time to more complicated prompts, web services, and conditionals.
In most cases, a tag starts with <%-
and ends with %>
such as
<%- date.now("Do MMMM YYYY") %>
which prints the current date in the given format.
Examples
Following find a list of examples showing off some of the most common tags and ideas. These examples are also included into NotePlan and you will be prompted to create them unless you already got templates. Feel free to copy & paste the templates from here into NotePlan by creating a new template in the Templates folder.
Daily Note w/ Affirmations
This template has three headings as a suggestion where you can split your tasks into the primary focus, morning (high energy) and afternoon (low energy) tasks. However, the "Journal" section has the interesting templating features:
<%- date.now("Do MMMM YYYY") %>
- prints current date with day, month and year- If you want to add or subtract days, you can append another variable, like
<%- date.now("Do MMMM YYYY", -7) %>
- If you want to add or subtract days, you can append another variable, like
<%- web.weather() %>
- prints local weather data<%- web.services('affirmation','affirmation') %>
- prints a random affirmation<%- web.advice() %>
- prints a random advice<%- web.quote() %>
- prints a random quote
The tags containing "web" are accessing websites to pull the information from the internet and therefore need an internet connection. It can take a few seconds for the data to load.
---
title: Daily Note w/ Affirmations
type: empty-note
---
## Primary Focus
- First:
- Second:
## Morning Tasks
-
## Afternoon Tasks
-
---
## Journal
*<%- np.date.now("Do MMMM YYYY") %>*
Weather: <%- web.weather() %>
Affirmation:
> "<%- web.services('affirmation','affirmation') %>"
Advice:
> "<%- web.advice() %>"
Quote:
> "<%- web.quote() %>"
Output
Daily Note w/ Prompts & Events
This example uses three headings: Primary Focus (for the most important goal of the day), Tasks (you need to do to reach it) and Events (where all your calendar events for that day get listed).
Note: You need to install the Event Helper plugin to make the event listing work, otherwise it prints an error.
The tags used in this template are:
<%- prompt('What's your mood today?',['🙂','😐','😕']) %>
- a prompt will ask you to select one of the three emojis and prints the selected one<%- prompt('Most important task today?') %>
- a prompt will ask you to enter a text value<%- listTodaysEvents({template:"- *|START|*-*|END|*: *|TITLE|*",allday_template:"- *|TITLE|*"}) %>
- prints today's events in the given format (needs Event Helpers installed)
---
title: Daily Note w/ Prompts & Events
type: empty-note
documentation: https://help.noteplan.co/article/136-templates
---
*Mood: <%- prompt('What's your mood today?',['🙂','😐','😕']) %>*
## Primary Focus
* <%- prompt('Most important task today?') %>
## Tasks
*
## Events
<%- listTodaysEvents({template:"- *|START|*-*|END|*: *|TITLE|*",allday_template:"- *|TITLE|*"}) %>
Output
Use Cases
- Habit Tracking
- Travel Checklist
- Readwise Integration
- Jira Integration - Get Active Tickets (Template)
- Todoist Integration - Get Active Tasks (Template)
- Log Data to Another Note in Templates
- Use AI prompts in your templates
Advanced
- Add web services to your templates (such as the bitcoin quote)
- Run JavaScript code in your templates
- Dates in Templates
Learn more
Contributions
Thanks to the plugin community, with special thanks to Mike (aka @codedungeon) for creating this templating engine and the plugins based on it! You can contribute with your ideas, reports, feedback or by working directly on plugins by visiting our Discord community or our GitHub repository.