Periodic note + templater doesn't replace commands

Hello,

What I’m trying to do

I’m trying to set my daily and weekly notes using templater and periodic note.

Here is my template for daily note :

date: {{date}}

<< [[<% fileDate = moment(tp.file.title, ‘YYYY-MM-DD-dddd’).subtract(1, ‘d’).format(‘YYYY-MM-DD-dddd’) %>|Yesterday]] | [[<% fileDate = moment(tp.file.title, ‘YYYY-MM-DD-dddd’).add(1, ‘d’).format(‘YYYY-MM-DD-dddd’) %>|Tomorrow]] >>

Objective

Day planner

Outcomes

Issue

This template works when I insert it directly on a note but when I create the daily note through the Periodic note calendar then the template commands such as tp.file.title are note replace in my file. It is the same if I use <% tp.file.creation_date() %> instead of {{date}}.

I haven’t found any explanation on the forum and article with this example seems to work directly ( exemple My Obsidian Daily Note Template | Dann Berg: blog, newsletter, shop, and more even If i use daily notes instead of periodic notes but the behaviour seems to be the same with daily notes.

You’re using both template engines in that code segment, which might cause issues every now and then depending on you create your note. I reckon you’ve already got the option Settings > Templater > Trigger Templater on new file creation enabled.

The thread below discusses some of these issues, and displays a way to code around it, and get stuff working after going either one or both template engines.

(With both template engines, I mean both the core template engine which uses stuff like {{date}} and then the Templater template engine which uses stuff like <% ... %> )

My Settings > Templater > Trigger Templater on new file creation was unabled I don’t know why, it is working now thanks