Error in Templater

The documentation for Templater states that if you use this template
Last modified date: <%+ tp.file.last_modified_date() %>
Then the date of the last modification of the file will change automatically each time the document is opened. But in practice, this pattern does not insert the date at all. Maybe someone knows what could be wrong here. This topic has already been raised here Automatically update YAML fields using templates - #7 by ariehen but no solution has been proposed.

I hadn’t heard of Dynamic Commands in Templater, so thanks for that. I did some digging and found an open issue in the plugin’s GitHub repo. It looks like they need more examples showing the issue. Maybe you can add yours there and see if that helps.

1 Like

I found the solution myself, and it’s so elementary that I’m ashamed of my stupidity. So this template is Last modified date: <%+ tp.file.last_modified_date() %>
works only in view mode. So it shouldn’t be like that

<%+ tp.file.last_modified_date() %>

otherwise you won’t see anything.

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