How to create a template in Obsidian (Beginner's Tutorial)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
if you're watching this video you are most likely new to obsidian so I have to say welcome this is a fantastic tool that is going to have a great impact on your life and your productivity as I'm sure you have seen there is a lot of obsidian content on YouTube and around the web and a lot of it is really complicated my goal is to make things super easy so you can get started as quickly as possible with the highest impact as possible in this video I'm going to show you two ways of using templates in obsidian the first way is going to work out of the box if you are new this is most likely all you need to get started and it is super simple the other way is going to be a leveled up version of templates that uses plugins and makes things a little bit more complicated but has a much higher reward and I'm going to show you why you might want to do that instead in case you're new to this channel hello my name is Dan I work in cloud computing with a specialty in Billing but for fun I've been publishing stuff on my website and I have a monthly newsletter and I just recently started making YouTube videos so so just having a good time with it if you like this let me know it's always good to hear encouragement and with all that said I'm going to start showing you how to do this here we are in a fresh brand new Vault so if you just open obsidian for the first time you haven't imported anything this is what it's going to look like and so let's just get started with templates right away the first thing I'm going to want to do is put a place or or create a place for me to put all of my templates so in this left hand folder here's the directory if if you press this button right here this is new folder let's create one we can just call it templates you can do that if you just want to be at the front um usually what I do is I have a folder I'm going to create it called extras and then in extras I'm going to have templates I might have images I might have scripts all of these different things in the extras folder so one of the extras is going to be templates so this is typically what I'll do but again you could just keep this at the top level here along with whatever else you want or you can put it in an extra layer of navigation great so now we're going to have a folder to put our template files let's create a new file so command n is how you create a new file and you can see that it showed up here it's called Untitled um I like to use a naming format you don't have to but let's just call it template comma example template and you can do template comma meeting notes template comma people notes template comma whatever you want you can use that here and then let's do whatever we want as our template so let's see like date name order number notes so let's say that we want this to be our example template so we've created this file the next thing we want to do is just move this into our templates folder so there's there's two ways to do that on the left side you could just click and drag and put it in the templates folder that works you can see that it's here now let's take it back out again one of the other ways that once you get a little bit faster with obsidian is easier to do uh is the command pallet the command pallet is basically just how you do everything in obsidian and to open the command pallet you just type command P that's for pallet and then you can type in move and you can see that there is move current file to another folder if you select this you can type templates and you can select your templates directory and it will move the file into this templates folder too using the command pallet took a couple of extra steps but you'll find as you get the muscle memory and you start doing a bunch of things with the command pallet usually it's actually a bit quicker than going and grabbing your mouse uh but again this is a personal preference do whatever you want uh so what we're going to do next is open the settings CU we're almost ready to use our templates right so go to settings one of the core plugins is templates and you can see under here it says core plugins this lists all the core plugins and templates is here already uh the first thing I want to show you is just going to community plugins you can actually sorry going into core plugins we're not going to look at Community left yet uh templates right here you can see that this is enabled uh you can see a bunch of other plugins that our core to obsidian and you can see there's a little gear these are the options this is going to take you to the same place these two do the same thing so in templates one of the things I want to do is this is template folder location I'm going to tell this that we put all of our templates in extras templates uh you can also specify the date format and time format I'm not going to touch any of that and with all that said we are now ready to use templates we can close this we can close this we can close the graph View and let's say we want to create a new note and then use a template so let's do command n to create a new note I'm going to call this just new note and then I'm going to use the command pallet to put in a template here so if you do command P for pallet and then just type template or just as soon as you start typing template there's going to be a bunch of different options so insert template I'm going to choose the one that we created and it just added all of these things from our template into this note here and one other thing I want to create or one other thing I want to mention with templates is let's create a new one so command n let's call this template snippet so templates don't need to be entire notes so this is a snippet it can be just part of a note that you're putting into someplace else so we've created this I'm going to do command P I'm going to type move move current file to another folder and let's move this into our templates folder so right now we have in the templates folder example template and snippet so I'm going to go back to our new note this is where we inserted this template if I just scroll down my cursor just a few more lines and then again I'm doing command P for the pallet typing in template insert template and let's do snippet this time and right where my cursor is it's inserting a a snippet or a template so you can use these templates as ways to do entire new notes that you want the full content that you fill out or they can just be little tiny Snippets that go in line wherever you want them to be and those are the super basics of the built-in template features super powerful and you can get going right now if you stick around I'm going to show you a little bit more advanced way to do things okay if you want to level up your template game there is a plugin that everybody uses most likely if you're watching other videos about this this is where people go to by default this is not the default cuz obviously this is super powerful but if you do want to level it up let me show you a little bit about what you can do with templ so the first thing we need to do is install the templ plugin which is a community plugin meaning that is created by people in the community rather than by the obsidian team itself so if we go back into settings we're going to go to community plugins this time and Community plugins need to be enabled so by default you're not going to be able to use any Community plug plugins but you can click this button to turn them on and then all we have to do is go into browse and you'll see the templator is so popular that it shows up here you don't usually need to type anything if you want to search for plugins you could obviously use uh the search feature but we're just going to go to templater right now we're going to click it and there's two steps to install a community plugin install and enable and that's it you're installed uh so just like we did in this is our regular settings we went to templates before there's also the templater plugin and one of the things I'm actually going to do is disable the original templates just so it doesn't get confusing at all so if you go to core plugins we scroll down to templates I'm just going to turn this off and you can see that it disappears here so let's go into templator again template file folder location we're going to choose extras templates because that's where all of my templat files are and you'll see that there's a lot more settings here uh including little hot keys that you can use you can select folders so that any new file created in those folders include templates from the start uh and a bunch of other things so browse through here to kind of see what's available uh and turn on the things that you want but with all this said one of the things I want to show you about templater is just how powerful it is with Snippets of code so I'm going to go to Safari and in Safari I have uh the templator website this is the documentation for templ and I'm going to include a link to this website in the description and as a quick example on their homepage you're going to be able to turn something like this into a result like this so let's just look at the one the the first example right in this original code creation date it uses this little snippet of code to insert the date so all of templat or code is between a bracket and a percent and then a percent and a bracket closes it and then this is going to be the actual code line that does various different things so you can see that TP do file. creation uncore date and then with open and close parenthesis is going to create an output that looks exactly like this uh and example uh or the other example is right below it modification date you can see TP file last modify modified date and then you can see that within this it specifies a specific format and that outputs to this specific format so there's a lot of things that you can do with this in terms of like the the terminology the syntax you can look at dates you can do files I'm not going to get into the full documentation of it except to say that this becomes super powerful when you're creating templates and one of the examples I want to do and I covered this in a past video this is an example of my daily note template so every day I launch obsidian I open my daily note and that's sort of the foundation that I'm working out of so anything new you can see I have a section that says notes that were created today and notes that were last touched today and so what this is doing is using a different plugin called Data view uh and it's going to be using templator Code which you can see all right here to create this data view table table that lists all of my notes that were either created today or touched today so in the future if I'm coming back to this daily note I can see all the notes that I wrote about this day as well as all of the notes that I worked on this day so this is where I become super powerful watch my other video which I'll link in the notes below to see the details about how to set that up but let's go back to obsidian right so what we're going to do is let's create just another uh template file so let's command new and let's call this template and let's call this templater example right and so let's go back to Safari and I'm going to do this created and then use the templat or code to get today's date so command C to copy let's go back to obsidian in this template I'm just going to use this created and then this templator code right here and then this is a template it uh I'm not sure why I would want to have that but you would have that code in there and again we're going to have to move this into our templates folder so command P move move current file to another folder type in templates and now we have this templator example in here and again we can go to our new note let's do actually another one new Note 2 templater and you can see we just typed template in the command pallet again but because we disabled template and we have templater enabled these are all templater options so create new note from template we're going to choose our templat or example and you can see that snippet of code that was in our template turned into the date and time like we wanted it to and that's the very basics of how you can get set up with templator which is going to level up your templates just a little bit so I want to show you two more quick things about templates that could just level up your game even more let's say you want all new notes that you create to be based on template files so you kind of have a base template and then you might have other templates that are related to other different areas of your note taking system that you're working in so let's create a base template we're going to do command n so template base template and this is what we want to use for all of our new notes um what I'm going to do is again let's enter in just this templat or code here what I want to do is go into settings and this is how I do it there are probably multiple ways to do this uh but you're going to have cot keys so usually the way that I am creating new notes is by typing command n and right now command n uh let's type in new create new note this short key is going to create a new note but really what I want this to do is create a new note from a template when I do command n so I'm going to press X to remove new note from here and let's type in templater great so now we can see templator create new note from template it's actually going to be option n which I don't like as much I'm just going to make this uh and then type customize this command do command n so now when I do command n it's going to give me a list of templates to choose from and it looks like our base template is not there can you figure out why I just realize this myself we didn't move it into the templates folder so let's go back to base template command P move move file to another folder move this to our templates and now if we do command n it's going to be base template and we can press enter and it's going to create us a new note based on on that template that we choose and now there's one more thing I want to show you that is going to level up your template game even more and that is being able to create a new note from a template by clicking a button and this is super cool like let's say you have meeting notes and so you have a meeting note that is the map of contents it stores all of your other meeting notes and then on this meeting note note you have a button to create these new notes for individual meetings what we're going to do in this example let's create a new page uh we can just do it off of Base template here let's call this parent and I just want to have this be our parent note and on this parent page I want to create a new button and this button is going to create a new note based on our example template for example so for this we're going to use an additional uh plugin so let's go to our settings we're going to go to community plugins I'm going to browse and I like metab bind for this So Meta bind is how you can create buttons and to do a bunch of other things so I'm going to click this I'm going to install and then let's enable this and then we can just go back to our page and if we do command P again this is the command pallet we can type in metab bind and one of the opt options is open Button Builder so let's collect this we'll just title this new example template at the bottom here there's templator create note so let's select this add action so as our template file all we want to do is create or select example template so this one right here yep example template uh for the folder we can choose what folder we want all of these new files to be in we haven't created any new folder so I'm just going to leave this the default new file name let's call this TK uh if you haven't seen TK before it's like a writer editor thing that stands for to come it's a letter combination that doesn't appear in English so it's easy to command F to find and then replace and so usually that's just a holder text for anything that I'm writing uh and then open note I want this to open when I click it so the next thing we do is copy to clipboard and let's paste it and you see that there is a code block that it puts in there but if I press return again this now renders a button so we have a button that says new example template and when we click this uh uh we got an error it looks like we need to specify a folder so just if you're following along and you want to know what just happened and what I just did I got an error and it said to check the developer log to see what it is so if you go into where is it view uh toggle developer tools right here and then console is going to be where loog or where errors are logged so I looked at metab bind I just read this a little bit and it said folder not found and so that's how I knew that there was an issue with a folder so let's create a new folder examples and then in here we'll look at this code I'm just going to recreate this button all over again because I like the button Builder and I don't want to try to edit it and get it wrong so command p uh metab bind button Builder new template example again templator create note add action template templates are example temp template here folder let's do examples default file name open note and let's try this again so now if we click this yep we should get a new note and it is based on our example template and there you go that's different ways to use templates in obsidian starting from the basic built-in way using the built-in template plugin and then upgrading it a little bit with the templat or Plugin with changing around the hotkeys a little bit and with creating a button that creates a new note from that button there you have it that was how to install uh and use templates in obsidian if you've liked this please give this video a like Please Subscribe please join my newsletter please check out my website DN b.org all of those are going to be in the description below and thank you so much for watching
Info
Channel: Dann Berg
Views: 5,214
Rating: undefined out of 5
Keywords:
Id: 91H_0ii4S-A
Channel Id: undefined
Length: 19min 57sec (1197 seconds)
Published: Fri Mar 08 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.