Templater Syntax Plugin Not Working

Would anyone have any idea what I could be doing wrong here? Thank you in advance

Issue:

Templater syntax not working

Example:

<%tp.date.now()%> remains <%tp.date.now()%> instead of:

<%tp.date.now()%> to 2022-04-23

Settings/Other actions taken:

  • Installed and enabled templater plugin, made sure it is updated
  • Set templater folder to “Templates” folder and my settings as:


  • Turned off core plugin “templates”
  • customized hotkeys of templater

1 Like

I’m having the same issue with my daily notes plugin. Not sure why

@fedderw To clarify, you are using “Daily Notes” core plugin (not the “Periodic Notes” community plugin), “Templater” community plugin, and have disabled “Templates” core plugin? Additionally, you’ve checked that your community plugins are up to date (“Settings” → “Community Plugins” → “Check for Updates” button, must be checked manually), closed and re-opened Obsidian after installing any updates to plugins, specified the correct Template file in the “Settings” → “Daily Notes” settings, and in the “Settings” → “Templater” settings you have “Trigger Templater on new file creation” turned on?

If you manually run the “Templater: Replace templates in the active file” command from your note that isn’t fully transforming, does any further transformation happen? Do you get any output in the developer console during the new note creation process?

To clarify, you are using “Daily Notes” core plugin (not the “Periodic Notes” community plugin)

No, I’ve been using periodic notes. Here is the error message from the console:

plugin:templater-obsidian:82 Templater Error: Template parsing error, aborting. 
 dv is not defined
log_error @ plugin:templater-obsidian:82

The template used starts like this:

---
creation date: <% tp.file.creation_date() %>

modification date: <% tp.file.last_modified_date("dddd Do MMMM YYYY HH:mm:ss") %>
---

<< [[<% tp.date.now("YYYY-MM-DD", -1) %>]] | [[<% tp.date.now("YYYY-MM-DD", 1) %>]] >>

If you manually run the “Templater: Replace templates in the active file” command from your note that isn’t fully transforming, does any further transformation happen? Do you get any output in the developer console during the new note creation process?

I actually get this error on any file where I try this command. Here is an example:

Templater Error: Template parsing error, aborting. 
 dv is not defined
log_error @ plugin:templater-obsidian:82
eval @ plugin:templater-obsidian:103
rejected @ plugin:templater-obsidian:57
Promise.then (async)
step @ plugin:templater-obsidian:62
eval @ plugin:templater-obsidian:63
__async @ plugin:templater-obsidian:47
errorWrapper @ plugin:templater-obsidian:98
eval @ plugin:templater-obsidian:3813
eval @ plugin:templater-obsidian:63
__async @ plugin:templater-obsidian:47
overwrite_file_commands @ plugin:templater-obsidian:3811
overwrite_active_file_commands @ plugin:templater-obsidian:3808
callback @ plugin:templater-obsidian:4010
jz @ app.js:1
t.executeCommand @ app.js:1
t.onTrigger @ app.js:1
t.handleKey @ app.js:1
t.handleKey @ app.js:1
e.handleKey @ app.js:1
t.onKeyEvent @ app.js:1

Do you have any scripts that are not for Templater in the folder Templater is checking for user scripts? Specifically, perhaps something for dataview that you import via dv.view somewhere? That makes Templater unhappy, as I and several others have discovered in the past few days/weeks.
Make sure the Templater user scripts folder just has things for Templater in it, perhaps by making a subfolder just for Templater within your current scripts folder and changing the setting on the Templater settings page to refer to that?

Yes, this was the problem! I made a seperate templater and templaterJS folder and that seemed to sort things out. Thanks!

1 Like