What I’m trying to do
I want to make a note template with a tag in the frontmatter that is called using this Templater snippet:
<%*
const tags = Object.keys(app.metadataCache.getTags())
let selection = await tp.system.suggester([...tags, "Make New"], [...tags, "Make New"])
if (selection === "Make New") {
selection = await tp.system.prompt("new tag")
}
tR += selection
%>
this tag then also should be replaced in this Dataview code:
LIST item.children.text FROM #tag
FLATTEN file.lists as item
WHERE contains(item.tags, "#tag")
Things I have tried
I tried to insert the Templater snipped in the tag frontmatter first but there I only get a empty field.
When using the Templater snippet directly in the Dataview code, I get an error (probably becasue it is inserted two times?)
How can I combine the two to work together and with the frontmatter?