Insert Template inside a template

What I’m trying to do

I am writing a templater script in which I also want to include another template. Does anyone know how can I do it.

Things I have tried

I have searched various threads and forums but not able to find anything.

Are you talking about the core template engine? Or the Templater plugin? Using the latter examples are found in the documentation on how to do this rather easily.

I’m talking about the Templater plugin…I tried using tp.file.include but it just copies the content of that file. What I want is for automatic updation of the frontmatter as well as the Headings in the new template.

my use case: I am creating a base template and want the content and frontmatter of this template to be applied to other sub templates that I am creating.

Eg: file tmplate1:

/—
task-type:
tags:
subtasks:
/—
#Heading1

now I have second template file template2:
/—
dimensions:
priority:
actual-end-date:
/—

/* Include template 1 file and update the frontmatter and other info as well */

you might be able to nest templater code with this commenting technique: https://www.reddit.com/r/ObsidianMD/comments/17au6mp/adding_comments_within_templater_files/k5k1zt0/?context=3

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