SilentVoid13 / Templater

A template plugin for obsidian
https://silentvoid13.github.io/Templater
GNU Affero General Public License v3.0
3.26k stars 198 forks source link

Link to a new file will trigger Templater in a specific folder #1422

Closed jankoweb closed 1 month ago

jankoweb commented 3 months ago

Description of the Issue

I have many subfolders with different templates, for example:

Suggestion

I want to be able to have one index file with links to these folders that will create a new file there, something like this:

Create diary: work | home | doctor

When I click on "work", a new file will be created in diary/work with the template that is set in Templater options for this folder.

This will be useful when a user has many folders with many files, causing the File Explorer Tree to be not very useful for searching for the desired folder.

Solution

I found a programming solution here, but the problem is that it is not dynamic (the user has to change it when they add a new folder).

Question

Is there any possibility to do this as a user without coding?

Zachatoo commented 3 months ago

I don't think it's within the scope of Templater to add this functionality without the user doing some coding.

I would recommend either using the Meta Bind, Buttons, or Advanced URI plugin in combination with Templater to accomplish your goal with less coding.

Zachatoo commented 3 months ago

I suppose you could link to diary/work/new.md and have a folder template that picks up newly created files in the diary/work folder and renames it from new to something unique. You wouldn't be able to use tp.file.rename though, you'd need to use app.vault.rename to make sure the link doesn't update. This seems like the least amount of code and effort to get what you want.

Zachatoo commented 1 month ago

Not planned.