I only recently discovered Obsidian, its plugins and the very active community surrounding it. I’m impressed and excited, to say the least. I’ve worked with quite a few note taking systems in the past. Never have I felt so confident that this might be the solution that will cover all my needs, in my personal as well as my professional life.
I would like to ask for advice for a specific use case with the Templater plugin. I’d like to create a few small “base” templates which will serve as building blocks for note templates. I.e.:
I have a fileDateInfoTemplate that utilizes the DataView plugin to display a note’s creation and modification date. It consisted of one line of code:
<sub>==Created:== `$= dv.current().file.ctime` ⋯ ==Modified:== `$= dv.current().file.mtime`</sub>
Example output:
I reuse the fileDateInfoTemplate in my DailyNotes template. Excerpt:
---
tags: DailyNote
---
<% tp.file.include("[[fileDateInfoTemplate]]") %>
<sub>==Prev. Daily:==`=" [[" + dateformat(this.file.cday - dur(1day), "yyyy-MM-dd") + "]]"` ⋯ ==Next Daily:==`=" [[" + dateformat(this.file.cday + dur(1day), "yyyy-MM-dd") + "]]"`</sub><br><br><br>
# `$= dv.current().file.name`
In the first line following the Frontmatter section Templater allows me to include the fileDateInfoTemplate into my DailyNote template. Output:
Above is the desired outcome, which I receive as long as I insert the DailyNote template with Templater into a note.
When I use the (Obsidian core) Daily Note plugin to create the DailyNote, the tp.file.include method is not resolved though, resulting in this:
I guess this is expected behavior since Templater is not involved when creating the Daily Note with the core Daily Note plugin? Is there a workaround to resolve the tp.file.include() even when the Note is not created by Templater?
Thanks!