Templater icon indicating copy to clipboard operation
Templater copied to clipboard

Templater Plugin Syntax Not Working

Open margarita-rivera opened this issue 2 years ago • 7 comments

I've presented this in the Bryan Jenks Community - work flow seems to be okay so he suggested to reach out here if in case it might be a technical issue

Issue:

Templater syntax not working

Example:

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

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

I've uninstalled/installed templates I am using and in loading a template it still shows this way:

Screen Shot 2022-04-23 at 7 28 31 PM

Settings/Other actions taken:

  • Installed and enabled templater plugin, made sure it is updated (prompted by discussion)

  • Set templater folder to my “Templates” folder and my settings as:

Screen Shot 2022-04-23 at 7 29 40 PM Screen Shot 2022-04-23 at 7 29 48 PM
  • Turned off core plugin “templates” (prompted by discussion)
Screen Shot 2022-04-24 at 11 50 41 AM
  • customized hotkeys of templater (prompted by discussion)
Screen Shot 2022-04-23 at 7 30 39 PM

Thanks for much taking time to read this! Hoping I just missed some setting here or something and this works soon fingers crossed

margarita-rivera avatar Apr 27 '22 15:04 margarita-rivera

Does replacing templates in file not resolve those commands?

AB1908 avatar Apr 27 '22 21:04 AB1908

I have the same problems, too.

woocore avatar Apr 28 '22 03:04 woocore

Would you be able create a new vault with the bare minimum set up and see if the issue persists? If it does, can you upload that vault here?

I ask because I'm sorry but couldn't reproduce this issue

Demo demo

Edit: hid demo gif

welpdx avatar May 25 '22 20:05 welpdx

I seem to be having this issue as well. None of the docs snippets render. I have tried:

  • creating a new vault with nothing but templater.
  • removed and reinstalled templater.
  • tried both AppImage and flatpak releases of Obsidian.

None of these have resolved the problem.

ghost avatar Jun 02 '22 02:06 ghost

@Miusaky, How are you executing Obsidian commands? (I.e., <% tp.date.now() %>)

There are 5 ways to execute Obsidian Comands.

You can execute Obsidian Commands that start with <% and <%* via these 3 ways:

  1. Create new note from template. (Default hotkey: Alt + N)
    new note from template demo
  2. Open Insert Template modal. (Default hotkey: Alt + E)
    new note from template demo
  3. Replace templates in the active file. (Default hotkey: Alt + R)
    Replace templates in the active file demo

You can also use dynamic commands <%+:

  1. Using Dynamic Commands by switching from writing to reading mode.

    Demo with Dynamic Commands demo
  2. Using Folder Templates. Adds Template content in new file, and executing Templater Commands

    Using Folder Template demo

welpdx avatar Jun 02 '22 07:06 welpdx

@welpdx I needed to enable 'Trigger Templater on new file creation'. It renders the date now. Should have read through the settings first. Thanks.

ghost avatar Jun 02 '22 12:06 ghost

@Miusaky Thanks for reporting back! I'm happy that you were able to fix your issue.

I had thought you had the same settings as @margarita-rivera, and that is why I did not mention the Trigger Templater on new file creation setting. Sorry.

By the way, I also didn't read the settings closely when I first started using it lol. It took me a while to get Templater working because I kept thinking that switching to obsidian's reading mode could execute static Templater commands (<% <%*) ! 🤦‍♂️

welpdx avatar Jun 02 '22 18:06 welpdx