How do I make it so that when I move a file to a certain folder (for example a People folder), a certain set of properties are “loaded” into that note?
I might want these five fields for each person I add, for example:
Role
Organisation
Phone
Email
Interests
Alternatively, if I add a “supertag” (like in Tana), those properties show up in the file.
There is a guide there as well. I think it’s better to learn a little bit about it (learn how to fish) than expect to be served a ready-made answer (the fish) each time.
A couple of tips:
In the description of the video, there is a link to a GitHub account, where you can copy and paste code from or even download the full demo vault, so you don’t need to type stuff, only change some details.
But you can easily understand and tailor the logic of the meta template to your needs.
E.g. the important thing is that the last one under <%-* } else { -%> should be the one that doesn’t qualify for any criteria (trigger with a dash) set above, so it will be a normal or default template for everyday needs. And if you need extra templates, you add them in the middle with the else if bits.
E.g.:
<%-* /* Extracting the Trigger if there is one */ -%>
<%-*
if (tp.file.title.includes("-")){
var trigger = (tp.file.title.split("-")[0]).trim()
} else {
var trigger = ""
} -%>
<%-* /* In case it is not a meta-template picker note */ -%>
<%-* if (tp.file.title.startsWith("Weekly")) { -%>
<%-tp.file.include("[[Weekly Review Template]]")-%>
<%-* } else if (tp.file.title.startsWith("Monthly")) { -%>
<%-tp.file.include("[[Monthly Review Template]]")-%>
<%-* } else if (tp.file.title.includes("template")) { -%>
<%-tp.file.include("[[Template for Template]]")-%>
<%-* /* If it is a trigger note then check which note */ -%>
<%-* } else if (trigger === "webclip") { -%>
<%-tp.file.include("[[WebClipper Template]]")-%>
<%-* } else if (trigger === "z") { -%>
<%-tp.file.include("[[Simple Zettel Template]]")-%>
<%-* } else if (trigger === "comp") { -%>
<%-tp.file.include("[[Computerese Template]]")-%>
<%-* } else if (trigger === "Comp") { -%>
<%-tp.file.include("[[Computerese Template]]")-%>
<%-* } else if (trigger === "Google") { -%>
<%-tp.file.include("[[Google iFrame Template]]")-%>
<%-* } else if (trigger === "google") { -%>
<%-tp.file.include("[[Google iFrame Template]]")-%>
<%-* } else if (trigger === "babla") { -%>
<%-tp.file.include("[[Babla iFrame]]")-%>
<%-* } else if (trigger === "Babla") { -%>
<%-tp.file.include("[[Babla iFrame]]")-%>
<%-* } else if (trigger === "Wikipedia") { -%>
<%-tp.file.include("[[Wikipedia iFrame Template]]")-%>
<%-* } else if (trigger === "Wiki") { -%>
<%-tp.file.include("[[Wikipedia iFrame Template]]")-%>
<%-* } else if (trigger === "wiki") { -%>
<%-tp.file.include("[[Wikipedia iFrame Template]]")-%>
<%-* } else if (trigger === "Wiktionary") { -%>
<%-tp.file.include("[[Wiktionary iFrame Template]]")-%>
<%-* } else if (trigger === "Wikt") { -%>
<%-tp.file.include("[[Wiktionary iFrame Template]]")-%>
<%-* } else if (trigger === "wikt") { -%>
<%-tp.file.include("[[Wiktionary iFrame Template]]")-%>
<%-* } else if (trigger === "word") { -%>
<%-tp.file.include("[[WordSense iFrame Template]]")-%>
<%-* } else if (trigger === "Word") { -%>
<%-tp.file.include("[[WordSense iFrame Template]]")-%>
<%-* } else if (trigger === "Wordsense") { -%>
<%-tp.file.include("[[WordSense iFrame Template]]")-%>
<%-* } else if (trigger === "pallas") { -%>
<%-tp.file.include("[[Pallas iFrame Template]]")-%>
<%-* } else if (trigger === "Pallas") { -%>
<%-tp.file.include("[[Pallas iFrame Template]]")-%>
<%-* } else if (trigger === "search") { -%>
<%-tp.file.include("[[Arcanum Template]]")-%>
<%-* } else if (trigger === "Search") { -%>
<%-tp.file.include("[[Arcanum Template]]")-%>
<%-* } else if (trigger === "lsj") { -%>
<%-tp.file.include("[[LSJ iFrame Template]]")-%>
<%-* } else if (trigger === "LSJ") { -%>
<%-tp.file.include("[[LSJ iFrame Template]]")-%>
<%-* } else if (trigger === "greek") { -%>
<%-tp.file.include("[[LSJ iFrame Template]]")-%>
<%-* } else if (trigger === "Greek") { -%>
<%-tp.file.include("[[LSJ iFrame Template]]")-%>
<%-* } else if (trigger === "s") { -%>
<%-tp.file.include("[[Source Prompt Template]]")-%>
<%-* } else if (trigger === "source") { -%>
<%-tp.file.include("[[Source Prompt Template]]")-%>
<%-* } else if (trigger === "sbook") { -%>
<%-tp.file.include("[[Book Source Template]]")-%>
<%-* } else if (trigger === "svid") { -%>
<%-tp.file.include("[[Video Source Template]]")-%>
<%-* } else if (trigger === "j") { -%>
<%-tp.file.include("[[Journal Template]]")-%>
<%-* } else if (trigger === "journal") { -%>
<%-tp.file.include("[[Journal Template]]")-%>
<%-* } else { -%>
<%-* /* Default Note if it's not a trigger note */ -%>
<%-tp.file.include("[[Default Note Template]]")-%>
<%-* } -%>
In the individual templates you are calling, you populate those with custom information:
E.g.