Click link to create new file with prompt to use template

Things I have tried

Scoured the forum.
Read and watched Templater Videos

What I’m trying to do

When I note take, I like to create new notes within existing notes by [[My New Note]] and then clicking the link. An empty note is made with the title and header (I have filename-header-sync enabled); #My New Note. All this is standard.

I want to be prompted to select from a template before the new note is created. Is this possible.?

Any suggestions or alternatives welcome?

Cheers

You can accomplish the same thing by using the templater plugin to ask for input and then format the resulting note based on your choices.

Brian Jenks has an excellent explanation here:

2 Likes

The Obsidian Memos plugin might be of your interest.

The above don’t quite hit my mark but that might because I get confused about how they solve my question. But I think I’m good, I’ll soldier on. thank you for your help.

OK I have tried umpteen Templater variants, created new vaults with refreshed plugins. Still no joy. :sos:

I would like to click the following text in a file " [[My Concept I wish to have as a new file but does not yet exist]] " and rather just create a blank note with “My Concept I wish to have as a new file but does not yet exist”, I’d like it to ask what template to use… and better still into which folder to place it.

Another useful variant would be clicking on " [[2022-03-05]] " creates a file with my daily log template in the folder where I keep my daily logs “Daily Logs/2022/03”

Any gurus out there?

Well I have found exactly what I was looking in a relatively little used plugin
https://github.com/mo-seph/obsidian-note-from-template by @mo-seph . Works a treat. Happy Days.

2 Likes

Hello Eric,

I had the same problem as you and also found that plugin. However, it is yet another plugin and from what it looks like it does not trigger a template when clicking on a link to a not yet created file, does it?

My approach:
I have a default inbox folder for new files (core feature under files&links → default location for new notes → in specified folder).
I set up templater (which I use anyways) to apply a template to every new note in that folder.
This template is like follows:

<%* let filetype = await tp.system.suggester(["Book Note", "Kanban Project", "Project Note", "Standard"], ["Book Note", "Kanban Project", "Project Note", "Standard"], false, "Which template do you want to use?") %>
<%-* if (filetype === "Book Note") { %> 
<% tp.file.include("[[Book Note Template]]") %> <% tp.file.move("/030 Media/031 Books/" + tp.file.title) %>
<%-* } else if (filetype === "Kanban Project") { %>
<% tp.file.include("[[Project Kanban]]") %> 
<%-* } else if (filetype === "Project Note") { %>
<% tp.file.include("[[Project Note Template]]") %>
<%-* } else if (filetype === "Standard") { %>
<% tp.file.include("[[New File Template]]") %>
<%-* } else { %>
<% tp.file.cursor(1) %>
<%* } -%>

Every time I create a new file in the inbox (=when I click a link to non-existing file), I get a suggester with the templates and then a file is created with the specified template.
The book note is even moved to a specified folder. You could add this to other templates as well or use the “auto file mover” plugin, which had been released lately.

Sure, this is still a bit fiddly and you need to set it up for every template you like to use but it works so far for the option of clicking a link.
Hope it helped a bit.

4 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.