While typing [[new_note]], I want to be able to create such a new note using a template


What I’m trying to do

I am working on my recipe book with the following setup:

  • Ingredients (default folder for new notes)
    • ingredient 1
    • ingredient 2
  • Recipes
    • recipe 1
    • recipe 2

The recipe contents have a part that looks like this:

  • 1 cup of [[ingredient 1]]
  • 2 spoons [[ingredient 2]]

Since I do not have many ingredients yet, I often type [[new ingredient]], then Ctrl+Enter to create it and Ctrl+W to go back to writing down the recipe. I have recently upgraded to using core templates plugin for a template for both recipes and ingredients (to add properties with tags and aliases). For a recipe, its not a problem for me to Ctrl+P → Insert template, but for each ingredient, it is yet another step and breaks the focus away from just quickly dumping down the recipe’s ingredients.

What I want: Set Obsidian in a way, so that by default, each new note automatically uses an ingredient template. (I can manually change that for recipes)
Alternatively: Find a slightly different workflow to be able to achieve similar results quickly.

Things I have tried

I tried downloading Templater and Quick Add plugins, but couldn’t figure out how to (and whether I can) achieve that with those.

Would it be an option to use a Templater template as a command to insert ingredients? So that each time you want to add an ingredient you hit the hotkey for that template, enter the ingredient and the template checks whether it exists or not. If it doesnt exist it’ll create it, and in any case it’ll return the link to the ingredient.

A variant of this could be to select the ingredient (as pure text), and have the template do its thing based on the tp.file.selection().

(If you’re not afraid of a little coding it could even be combined with a suggester based upon existing ingredients… )

1 Like

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