Creating a new note using a template not working
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Create a template-style macro.
- Set the Template Path to an existing template (not a Template template).
- Using the Command Palette, run the macro.
- The new note is created, but the template is not applied. All that appears in the template is "undefined".
Expected behavior A clear and concise description of what you expected to happen.
- I expected the template to be applied.
Screenshots If applicable, add screenshots to help explain your problem.
- Here's the template: https://cln.sh/8METNK+
- Here's the definition of the Quick Add "Create code snippet" macro: https://cln.sh/naDOUI
- Here's the resultant note: https://cln.sh/m8fvlm+
Desktop (please complete the following information):
- OS: [e.g. iOS] macOS 11.0.1
- Browser [e.g. chrome, safari] Safari 14.0.1
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
- There is an additional bug that I have observed but not in this particular test case — I was at one point able to get the template to insert, but any placeholders in it (e.g.,
{{date}},{{title}}) were not expanding. I also tried a Templater-based template, but that didn't work either.
I believe I also get the bug described in Additional context when QuickAdd tries to create a file with a given template in Capture mode, if the target file does not exist - the {{title}} template is not expanding.
Same here: {{title}} and {{date:gggg-MM-DD}} are not expanded. I thought that was just a difference in the supported syntax {{NAME}} for example works.
Is this a bug then?
ah, ok. I have this issue as well. If I capture a note on a file that isn't there it doesn't render the template, only copies it. Working with my daily note template like this means that I'd have a lot of daily notes that aren't properly created and that is core to my workflow.
I would expect the {{title}} template variable to be honored. Instead, QuickAdd uses {{name}} and this breaks certain parts of my workflow.