quickadd icon indicating copy to clipboard operation
quickadd copied to clipboard

Creating a new note using a template not working

Open swehba opened this issue 4 years ago • 4 comments

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Create a template-style macro.
  2. Set the Template Path to an existing template (not a Template template).
  3. Using the Command Palette, run the macro.
  4. 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.

swehba avatar Sep 14 '21 18:09 swehba

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.

jdheyburn avatar Sep 28 '21 08:09 jdheyburn

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?

sagikazarmark avatar Sep 30 '21 15:09 sagikazarmark

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.

freyquency avatar Aug 06 '22 16:08 freyquency

I would expect the {{title}} template variable to be honored. Instead, QuickAdd uses {{name}} and this breaks certain parts of my workflow.

vvatikiotis avatar Apr 23 '24 17:04 vvatikiotis