I want to create a solution to dynamically create template from a template based on Dynamic list of values shown in a suggester prompt UI.
for example i have Meeting Template, the template have two frontmatter variables
program:
Project:
Now i want to create two files in my vault
Program
the content of this file would be a list of all programs in any format that works eg.
[program1, program2, …]
or as a list
program1
program2
…
similarly another file for projects.
Then i want to have a QuickAdd action to trigger template, the template would show suggester UI prompt that load the list of program from the program file so i can select a program name from the list, and populate the fontmatter variable program in the file.
As i create new programs and/or projects, i will add its name to the file in my vault, the prompt suggester loads it in the UI when i create new meetings.
I’ve tried to use templater script + quickAdd but i wasn’t able to get it to work, any suggestions?
---
alias:
project:
tags: meeting,
---
<%*
// load from some location
let projects = ['p1', 'p2','p3'];
let proj = await tp.system.suggester(projects, projects);
console.log(proj);
// How to set frontmatter project value?
_%>
## Notes
-
That’s an excellent question - would love to see a way to do this. For now, I accomplish something similar by putting all projects into its own file within a folder. The code below allows you to search all files within a folder, and then narrow down search via frontmatter. Hopefully it gives you some ideas…