What is Startup Templates #1270
Unanswered
samandar-boymurodov
asked this question in
Help
Replies: 1 comment
-
A startup template is a template that will run when Obsidian is opened. That's it. You could have a template like the following, and every time you open Obsidian, you'll get a notification. <%* new Notice("Startup complete!") -%> Now, usually this isn't very useful unless you're setting up global variables you want to use in other scripts, or to hook into Obsidian events. You can look at the Obsidian API docs to find a what events you can hook into. For example, if you want to hook into the file create event, you can do something like this. <%*
app.vault.on("create", (file) => {
new Notice(`File was created with name '${file.basename}'`);
});
-%> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello Templater team,
I would like to know how Startup Templates feature works in Templater plugin.
From its description, it feels that we can run specific hooks on note creation, deletion, and so on. But I could not actually use it. Is there any guide on how to use it properly?
Beta Was this translation helpful? Give feedback.
All reactions