-
Hi everyone, I've been working on my first Templater template with help for this forum, but I'm a complete Javascript novice. I've pulled bits and pieces from examples all over the web, and I'm making some good progress without actually knowing what I'm doing. My template is designed to prompt for two values and use those two value to rename the file, which works fine. Next it displays a suggestor with a list of filtered tags from my tag hierarchy and allows the user to select one, then puts the selected tag in a field in the front matter. The suggestor is popping up and displaying the correct selection list and I select one, but the return variable is showing up as 'undefined' when I apply the template. Here's the template: <%*
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Change this line const selectedTag = (await tp.system.suggester(t => t[0], electronicsTags)[0]); to this const selectedTag = (await tp.system.suggester(t => t[0], electronicsTags))[0]; Also, because I think you'll run into this soon, you should use whitespace control to ensure the frontmatter is properly parsed by Obsidian. <%*
// your block of code here, notice the -%> instead of %>
-%>
---
tags:
- <% selectedTag %>
Manufacturer: <% manufacturer %>
Model: <% model %>
Charging Type:
OS:
Updated:
--- |
Beta Was this translation helpful? Give feedback.
Change this line
to this
Also, because I think you'll run into this soon, you should use whitespace control to ensure the frontmatter is properly parsed by Obsidian.