Templater Template

I have the following Template:
<%*
let title = tp.file.title;
const Kaarten = [“Concept”, “Idee”, “Verklaring”, “Persoon”, “Ding”];
Note = await tp.system.suggester(Kaarten, [“01 Concepten”, “02 Ideeën”, “03 Verklaringen”, “04 Personen”, “05 Dingen”]);

if (title.startsWith("Untitled")) {
    if (Note == "01 Concepten") {
        qcFileName = await tp.system.prompt("Titel van het Concept");
        titleName = qcFileName + " " + tp.date.now("YYYY-MM-DD");
        await tp.file.rename(titleName);
        await tp.file.move("/03 Kaarten/" + Note + "/" + titleName); 
    }
    if (Note == "02 Ideeën") {
        qcFileName = await tp.system.prompt("Titel van het Idee");
        titleName = qcFileName + " " + tp.date.now("YYYY-MM-DD");
        await tp.file.rename(titleName);
        await tp.file.move("/03 Kaarten/" + Note + "/" + titleName);
    }
    if (Note == "04 Personen") {
        qcFileName = await tp.system.prompt("Naam van de Persoon");
        titleName = qcFileName;
        await tp.file.rename(titleName);
        await tp.file.move("/03 Kaarten/" + Note + "/" + titleName);
    }
await tp.file.include("[[/01 Systeem/01 Templates/Test]]"); // Replace with the actual path to your Concept template
}

-%>
<% tp.file.include(“[[/01 Systeem/01 Templates/Test]]”) %>

I would like to make it so that every different option that I select will include a different template file. Because I want every option to make a different note in a different folder with different Properties at the top of the note.

I already solved the issue: Just had to make the path to a file that I want to include in the new note a string within the if statement. Then call the file to include outside of the code block, with the sting as a path to that file. In that way I can make every choise have a different template to start the note with.

  • Sorry for my bad English

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.