Templater code in daily note template doesn't create new note with Folder Template

What I’m trying to do

I have a Templater daily note template based on examples in the community with date navigation to previous and next daily notes.

When I create a daily note and switch to reading mode and click on a navigation date (for a daily note that doesn’t exist yet) it creates a new note. But it doesn’t use the Folder template that I have set in Templater. See screenshot below.

What I’m trying to figure out why this doesn’t work and how could I get this to work? Thanks for any suggestions.

---
creation date: <% tp.file.creation_date() %>
modification date: <% tp.file.creation_date("dddd Do MMMM YYYY HH:mm:ss") %>
---
<< [[<% tp.date.now("YYYYMMDD", -1, tp.file.title, "YYYYMMDD") %>]] || [[<% tp.date.now("YYYYMMDD", 1, tp.file.title, "YYYYMMDD") %>]] >>

## To do

## Activities

## Meetings

I think that is the correct behavior if your daily note folder and your default new note folder are different.

I have a daily note folder and my daily notes get created by the Daily Note plugin within that folder.

I have a default New Note folder, that is a different folder, where any new note is created. My daily note is not created in this folder.

When I click on my next day link in my daily note (I have a similar setup as you with the dates at the top), then this new ‘daily note’ is created in the new note folder and it uses my new note template, not my daily note template.

Basically, the Daily Note plugin isn’t watching for you to click on a non-created note link within your daily note and then grab that action and create the new note as a daily note. Obsidian just creates a default new note in the default new note folder when you click on any non-created note link.

Hi @Obsidandnancy Thanks for your explanation.
My setup is slightly different. My default location for new notes is ‘Same folder as current file’.
Besides that I have my Daily Note template defined as default template for my ‘Timebased’ folder in Templater when a new empty file is created.
Since I click a non-existing file link from a note in the Daily Notes folder (in my case Timestamped) I would expect that Templater would be triggered.
In Templater settings is written

Folder Templates are triggered when a new empty file is created in a given folder. Templater will fill the empty file with the specified template.
The deepest match is used. A global default template would be defined on the root /.

I would expect that it would use the Daily Note template when an empty link creates a new empty note in that folder.

In the end I found what made the template not being used. It was an error in the previous and next daily note syntax
The correct code should have been

<< [[ <% tp.date.now("YYYYMMDD", -1, tp.file.title, "YYYYMMDD") %>]] | [[<% tp.date.now("YYYYMMDD", 1, tp.file.title, "YYYYMMDD") %>]] >>

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