Hello Forum,
first: I’m absolut clueless in javascript, what I have thrown together here, I got all thru try and error from other fellas…
So,
within templater I try to get a value from YAML of a file and also the link to this
the frontmatter of the files looks like:
file_1
---
projekt: "Test_1"
objekttype: Projekt
---
file_2
projekt: “Test_2”
objekttype: Projekt
file_3
---
projekt: "Test_3"
objekttype: Aktion
---
Only files defined as projects
objecttype: project
→ so I set objekttype != "Aktion"
as shown further down
should be displayed via suggester.
Things I have tried
my entries in the templater-template:
---
<%* const dv = this.app.plugins.plugins["dataview"].api;
let projects = dv.pages();
let all_projects = projects.where(p => p.objekttype != "Aktion");
let prNames = all_projects.projekt;
projekt: <%* tR += await tp.system.suggester(prNames, prNames); %>
---
that works fine so far.
but when I try to add the command to get the link further down in the note
via an additional row in the code
---
<%* const dv = this.app.plugins.plugins["dataview"].api;
let projects = dv.pages();
let all_projects = projects.where(p => p.objekttype != "Aktion");
let prNames = all_projects.projekt;
projekt: <%* tR += await tp.system.suggester(prNames, prNames);
let prLink = all_projects.link; %>
---
and try to call it (outside of YAML) with
projekt: <%* tR += await tp.system.suggester(prLink, prLink); %>
there are no entries in the templater suggester
What I’m trying to do
trust in your craft and knowledge.
I’m sure it’s only trivial for you, but I’ve been fiddling for hours.
regards