I'll say in advance that this is a very long article. I did publish it in multiple parts on Medium, but I think it works a bit better here on Hive (since the article was written in markdown) since you can see and navigate with headings a bit more easily on Hive.
Additionally, this article is about working with templates in the software program - Obsidian (http://obsidian.md). Obsidian is a "Tool for Thought" - a.k.a. a note taking app - that you can customize to fit the way you work.
If you'd like more content like this, please let me know.
(Note on images: Unless otherwise noted, all images in this article are original screen shots and images I created).
Templates are powerful tools for automating workflow and helping you get more done with more ease in any application. They are especially powerful as a workflow support in Obsidian.
In this series of articles, we'll be looking at the two most commonly used Template tools - the Templates Core plugin and the Templater Community plugin and digging into a myriad of ways that you can use them - focusing most heavily on the Templater Community plugin.
The Templates Core plugin in Obsidian will allow you to build templates and you can insert dates and times automatically into them, along with the note's title. The Templates Core plugin integrates well with the Daily Notes Core plug-in and the Unique Note Creator Core plugin. The Templates Core plugin allows you to keep your vault in Restricted Mode if that is important to you. I'm going to write about the Templates Core Plugin assuming that you are using it predominantly because you wish to leave your vault in Restricted Mode and not add any Community plugins. I recognize that might not be the case for you and if so, you can certainly make use of Templates with other Community Plugins.
The Templater Community plugin is, according to its creator, "a template language that lets you insert variables and functions results into your notes. It will also let you execute JavaScript code manipulating those variables and functions." Templater is a Community plugin so it does require that you leave Obsidian's restricted mode to use it. That said, it includes many more features than the basic Templates Core plugin and it is, as I write this, the sixth most highly used Community plug-in with over 230,000 installs.
My advice is generally to start with the "lowest" level of any tool that you can and then work up from there as you get more comfortable. That said, there are some pretty distinct functionality differences that would cause you to have to rework your templates if you switch so I actually recommend you start with Templater - but I will walk through how you can get the most out of the Templates Core plug-in before we get there.
I get a lot of value out of looking at other people's templates and so I will provide you with several examples of templates here - and in upcoming posts - for things you might want to include in your templates. That said, I think what you put in a template - and particularly how you arrange it in a template - is very much about who you are as a person and so I don't see much value in simply copying and pasting someone else's templates and using them for yourself.
So, that means you have to create a lot of your own templates. By all means, do a quick google search and find links to starting points - but you will get more value if you customize these templates to the way you think.
Here are several examples of templates you could create in Obsidian (or really in any Tool for Thought):
Any text that I might use over and over again, I'll create a template for.
EVERY checklist you use makes for a good template. Here are a few of my favorites:
So, now that you've gotten a few ideas of templates that you might use - and again, I urge you to comment with any other templates you think of - let's dig in first to the Templates Core plugin.
I wrote this article as a way to pull together my own knowledge about templates into a single place and to really refine my own core processes around template use. As an example, one of the things that has come out of this process is that I'm developing a new syntax for how I name templates and whether they are designed to be used in an existing file (they get the letter f at the front of their name) or they are designed to be used in a new file (they get the letter n in front of their name). While for some templates it really doesn't matter, for others it does and so this exercise of writing this and thinking in depth about Templates has allowed me to get really serious about making my templates as automated as possible for my specific use cases.
The article got SUPER long though so I did divide it into parts.
To get started with the Templates Core plugin you need to make sure it is enabled in your vault.
Open your vault and go to settings.
Select Core plugins on the left
Scroll down in the right hand portion of the Core plugins box until you see Templates. Make sure its toggle button is pushed to the right to indicate that it is on.
From here you can actually go ahead and also set your options for the Templates plug in. The one you must set is a folder for all of your Templates.
To do that from here, just click the cog button right by the toggle switch. If you want to access that page at any time, you can also do so by scrolling down on the left and locating Templates under the Core plugins section.
So, clicking this cog wheel
or scrolling down under Core plugins to Templates both give you the Templates option screen
Let's go ahead and say our templates will be in a top level folder called Templates (again, so creative, I know). Just type Templates in the Template folder location box and then close that window using the X just above where you typed Templates.
And, finally, we need to create our Templates Folder. Click the New Folder button.
And then type Templates
We're going to use a Meeting Notes Template as our first template. You can watch how I did it, and then you can follow along step by step below.
In the templates folder, create a new note and name it Meeting Notes. You can do this by right clicking the templates folder and selecting New Note or by making sure the templates folder is selected in the file explorer and then pressing Ctrl+N on the keyboard.
We're going to use a little piece of code to indicate that we want the title we give our note to be included as a header in the note. So, type # {{title}} on the first line and then press enter.
Now, when you run this template you'll enter a title and it will automatically get added to this spot in the template when you accept the title. Don't worry if that doesn't make sense - we'll walk through it again in a moment.
We're also going to add the date to the file. The date will be in the format of YYYY-MM-DD because that was the format we set in the Template options screen. If you include this little date script inside of a pair of double brackets you will automatically create a backlink between your daily notes for this day and the meeting notes you take.
Now that we've got our tiny bit of scripting out of the way, you can add your remaining headers. I'm going to add # Agenda, three dashes to make a horizontal row, # Attendees, # Notes, and # Action Items as my main sections.
The image above shows the template in Source Mode. As you can see, I also added a single check box under action items so that is already there for me to start adding action items. This is what it looks like in Reading Mode (if you're not sure how to toggle between those modes, click the three dots on the top right side of any note and you'll see these toggles in that menu.)
Now that you've made your template, it's time to use it. Let's create a note for today's Team Meeting. I personally include the date in the note meeting title - how you name your notes is up to you.
You should now see your Template on the screen - already pre-filled for you.
As an alternative to the Templates command in the command palette, you can also use the Templates button on the left to add a template to a page.
You can also use the Templates Plugin to insert the time and date into any note. We'll demonstrate this with time.
To do this, place your cursor where you want the time inserted.
Using Ctrl+P again, bring up the command palette. Start typing te for Template. This time, select Template: Insert Time
As soon as you hit enter on that line, the current time will be inserted into your file where your cursor was.
You can also set this up as a Hotkey to make it a little faster to apply. Let's walk through that process.
Open up the Settings panel using the cog wheel.
Select "Hotkeys" from the left hand menu. Scroll down to Templates or type tem in the Search box to locate templates.
Click the "Customize this command" button on Templates: Insert current time
Press the keyboard command of your choice using some combination of command, shift, and alt as well as letters, numbers, and symbols. I used Ctrl+Shift+t for the Insert current time command.
Once set, close the hotkey window and try it out. Place your cursor somewhere in a note that you want the time inserted and select Ctrl+Shift+t (or whatever key combination you chose) to insert the time.
There are many different types of notes that you could use a template for. Among these are the very commonly used daily, weekly, monthly, quarterly, and yearly notes. Lets use these common note types to look at other ways you can use date and time formatting within your templates to streamline note creation.
A Daily Note is used by many in the Tools for Thought page as their daily log file to record all of their thoughts, tasks, and information for that day. We're going to start by creating a simple template that uses a few of the alternative date formats for our daily note.
Now, to give it a full test drive, let's set up the Daily Notes Core Plugin.
This will let us see how the Daily Notes template can be called by another plugin and automatically filed where we want it.
Open Settings
Make sure the Daily Notes Core Plugin is enabled from the Core Plugins Screen.
Now, under the Core Plugins section, select Daily Notes so we can set its options. We need to first confirm the date format. I like the format of YYYY-MM-DD so I'm going to leave it as is. If you'd prefer a different format, you can click format reference on the window to see the key for how to format various date formats. I'll be showing you several examples of this in the screens that follow. Now, we're going to choose where all of our daily notes get stored. I like to keep all of my time based notes in a folder called Logs and then divide them into separate folders by note type. As you can see, I entered Logs/Daily Notes in the New file location box. We'll create this file location right after we finish the settings. And, then, select the location To your Daily note Template. Finally, I turned on the toggle so that when I start up Obsidian, my Daily Note will open on startup just because I prefer that option.
Finally, let's go add the Logs folder and the Daily Notes folder inside of it.
You're now ready to test your first daily note. You can create the daily note using the Command Palette (Ctrl+P and then Da for Daily) or by clicking the Open Daily Note button on the menu bar.
This is what my first daily note looks like. If you used my template, you should get something similar but with the correct dates filled in.
You're now ready to start using your daily note.
You can do a lot of additional customization with the date and time scripts if you want to. Full documentation for that is located on the moment page.
If you want to push the Templates Core Plugin to its limits without adding any Community plugins then you may also want to use the Note Composer Plugin.
Note: You might also want to use the Unique Note Creator Plugin which lets you create a template for Zettelkasten style notes. That said, I personally can't make sense of a Zettelkasten file structure based on date codes so with the information you already have you'll be able to use this plugin and I hope some day you'll help me see how a Zettelkasten based on date and time codes can make sense to someone.
The Note Composer Plugin allows you to specify a few additional pieces of data in your template using your script. Let's create that template first and then we'll give the Note Composer Core plugin a run for its money.
Create a new note in your template folder. Call it Extracted Note.
In your Extracted Note, you can use commands like {{fromTitle}} {{newTitle}} {{content}} and, of course, date and time. This is the simple template I set up for an Extracted Note
Notes that I used double brackets outside of the double curly braces for fromTitle and date in order to create automated links back to the original file and to the daily note.
Now, you need to turn on the Note Composer plug in and set its template location. Again, this is just as we've done before so this time I'll just show you what the options screen for Note Composer looks like when you're done.
Now, to use this new functionality, you need two files.
The first is the file that has all the text. I used a short extract of the text of this article and created that note.
Then, you need to create a new note that uses the Extracted Note template. I named that file Zettlekasten Plugin.
Now that you have both of those files created, you can go back to the One More Plugin File and select the text in that middle paragraph, then right click the text, and select Extract current selection....
A file window will open and ask you what file you want to put this text into. Choose your Zettelkasten Plugin file.
Your One More Plugin file will now have a link to Zettelkasten Plugin where that text was and your Zettelkasten Plugin file will include the link to the original file, the date formatted as a link, and the extracted text.
These two images show what that looks like in its final form.
As I mentioned in part 1, you can create additional templates with the Templates plugin, but I think time is better spent learning more about the Templater plugin and really focusing on ways we can automate routine tasks with our notes - so let's turn our attention to that in Part 3.
If you'd like to watch a major portion of this part, you can see that on YouTubelanguage.
To begin using the Templater Community Plugin, you must leave Restricted Mode in your vault.
To do this, go to Settings > Community Plugins > and click "Turn on Community Plugins"
Now, it's time to install the Templater Plugin. On the Community Plugins screen, click Browse and search for Templater.
On the options screen, if you take a moment to scroll through it you can see there is a LOT more we can do here. We won't cover all of it, but we'll get some of the most important things covered.
Go ahead and set your location for your templates. I would actually go ahead and set it to the Templates folder you already have set up, even if you have a LOT of other templates already created. It's easier to just edit all of these files as you need them to use all the new features we get with templater.
Note: If you decide to read on with the Templater instructions, you will, at some point soon, want to disable The Templates and Daily Notes Core Plugins so that you can use only Templater and likely the Periodic Notes Community Plugins. I won't provide instructions for that specifically but simply remind you that you will need to make sure you do that. You'll see me struggle with what happens when you don't if you watch the video. I'll go in depth on Periodic Notes in a later article/series
Let's go ahead and open up our meeting notes template and see some of the new things that we can do with it now that we're using Templater.
This is what our Meeting Notes Template looked like when we last saw it:
We're going to change the name of this template to Team Meeting Template. We're doing this because we're going to make the text of this meeting template much more specific to only our team meeting to allow us to automate these agendas in a flash.
Let's begin by changing the title and date at the top to use the format language called for by Templater.
To be very clear, I am not a coder. What I figure out, I learn through a lot of reading and trial and errors. So, if I mix up my Java Script and my something else, please feel free to correct me with kindness - I will be happy to learn from my mistake - just remember to be kind.
According to the Templater website, it uses the Eta templating syntax.
Each command in Templater begins with a <% and ends with a %>
Inside of the command, you place the functions.
Functions begin with tp followed by a dot
Functions come from one of seven modules (for internal functions which is the bulk of what we'll cover here). You need to tell templater which module you're going to use. The modules are:
After the module, you put another dot.
And finally, you're ready for the function. Functions often contain some sort of argument which is included in either parenthesis or brackets.
So, while it was easy in the Templates Core Plugin to just say {{date}}, we have to use a little more complicated format to get the date in Templater. Don't worry, very soon I'm going to show you how beneficial that functionality can be.
We now have to get the file's title using the tp.file.title command. Notice that we've put it inside of double brackets again so that it will update as we update the name of the file. We did the same thing with the Date - putting it inside of double brackets. The date function also requires a set of empty parenthesis since there is an argument needed for that command.
Here's the really fun part though.
At the very end of our file, we're going to add a command that will move this file to the folder where we want it to ultimately end up. Don't worry - we're going to look at an alternative way to do this from within the Templater plugin, but I think knowing both methods has a lot of value. We do this using the file module and the move function. The move function needs an argument that essentially tells it where to put this file. While you don't have to, the documentation indicates putting an await command at the beginning of this command. According to Stephen Millard, this extra javascript command, while not necessary now, could keep things from "piling up" in computer processing as you add on more and more complexity.
I decided I wanted my files to be sorted by type under a generic "Meetings" folder so this meeting will go into my Team Meetings folder.
<% await tp.file.move("/Meetings/Staff Meetings/" + "/" + tp.file.title) %>
Before we do the big reveal, let's go back to this file and make it much more specific to our actual Team meetings by adding the regular attendees. I added check boxes in front of their names so that I could easily check who was there and who wasn't. I also added a set of standing agenda items and then finally, I added a task to distribute notes.
Depending on how you organize your files, you could create a template for each primary folder location (e.g. if you have /Meetings/1-on-1/ and /Meetings/Executive Council/ these would be two different templates with two different move statements at the end of each.) In my sample vault that you can download (details below) you'll see a few different examples of meeting note templates being directed to different folders. In the vault, I'm doing it using the built in feature of the Templater Community Plugin so let's look at that next.
If you open up the Templater Community Plugin settings, you'll see an option to "Trigger Templater on new file creation". This option is turned off by default. Let's turn it on and see what happens.
Anti-climactic - right! It looks like nothing happens. However, if you scroll down on the Templater options screen a little bit, you'll notice a new section labeled Folder Templates got added. Automation opportunities await!
We already know that we want our team meeting template to automatically get put into our Team Meetings Folder so let's set the Team Meetings folder to be our folder in the left hand box and our Team Meetings template to be the template that fires in our right hand box.
Now, just to make sure there is no funny business here, let's make sure that we've deleted that last line of code from our Team Meetings template - the line that looks like:
<% await tp.file.move("/Meetings/Staff Meetings/" + "/" + tp.file.title) %>
Now, let's test this out and see what happens.
We trigger the Folder Templates function by creating a new blank file in a folder that has a template tied to it. So, right click the Team Meetings folder and select New Note.
A new meeting notes file will be created using your template - just give it a name and you're ready to go.
So, which is the best way to go? That's entirely up to you.
I personally prefer the method of putting the code snippet into the file for two reasons:
For templates you use regularly, you can speed up your processing even more if you're a keyboard-centric person by assigning specific keyboard shortcuts to specific templates. When you combine this with the fact that the template itself creates the file in the folder where you want it, then you've created a pretty slick system for making sure files go where you want them in just a couple of keyboard commands.
Let's demonstrate that with a Project Template.
I want a folder called Projects that I'm going to put all my Project files in.
Note: I have a base template for templates (yes - it's called Template Template). The problem with it is that as soon as I run it on a new file the file.move command has run and is deleted from the file. So, when I create the new template, it gets automatically created in the Templates folder, but I need to add that line of code again to place the new template file where I want it. This is a place where I use TextExpander in combination with templates to streamline this work. I have just that last line of code saved in TextExpander so I can add it again quickly if I need to.
Let's try it out.
As I wrap up this article, I thought I'd run through several templater commands and functions and then you can let your mind run through with those. If you find this useful, I hope you'll post comments with your own examples or let me know how you put these together to build templates that let you automate different tasks in your life.
!
Templater compliments many other Community Plugins. Just a couple of those are:
In pulling together all my thoughts and notes for this article, I found a large number of really great resources about Templater and thought I'd close out with those. Where one was directly used in an example above, I tried to make sure I credited it in line above so that you see clearly that this is in no way all my work.
I would truly love to know what you thought. What did I get wrong? How could I make this better? What else would you like to learn about?
There are many ways you can support my work if you’d like to do so. Here are several options.
Reblog this article on Hive
Like/Upvote this article on Hive.
Subscribe to the Knowledge Work Nexus YouTube Channel
Download the vault of templates used to demonstrate this series. It’s available as a pay whatever you want download on Gumroad.
Buy Me Some Berries using this button.