Integrate frontmatter Values with Note Body

Use case or problem:

I am writing to propose an exciting addition to Obsidian MD that would greatly enhance its capabilities and provide users with the ability to seamlessly integrate dynamic content into their notes.

Proposed solution:

To achieve this functionality, I suggest implementing a feature that allows users to utilize file properties and insert their values directly into the body of their notes. This can be done by introducing a YAML front matter system that enables users to define file properties at the top of their notes. This section would serve as a repository of key-value pairs, allowing users to assign values to specific properties. Users can then effortlessly insert these property values into the body of their notes using a straightforward syntax, employing double curly braces ({{ }}).

Example:

---
myProperty: My Value
---

# My Note
This is the value of myProperty: {{myProperty}}

In this example, the {{myProperty}} placeholder will be dynamically replaced with ā€œMy Valueā€ when previewing or rendering the note. Any modifications made to the value in the YAML front matter will automatically propagate throughout the note.

Current workaround :

Use the Templater plugin. For example, if you have a file property called ā€œauthorā€ in your note, you can use {{tp.file.property("author")}} to insert the authorā€™s name into your note.

However, this doesnā€™t completely function the same way as my proposal above because you cannot cite values from the frontmatter as you are writing the note.

There was also a plugin called: Obsidian Inline Variables, which had the intention of bringing this functionality to Obsidian but it appears to have been abandoned.

Related feature requests (optional):
None.

5 Likes

Iā€™m looking for the same solution. But I also understand any reluctance to ā€˜polluteā€™ the markdown document with non-standard markup.

Iā€™m sure we all came to markdown for the simplicity and lack of vendor lock-in. But then we miss the features of our old proprietary applications.

In the mean time, this might help: Obsidian Meta Bind. I found it to handle the use case quite well.

2 Likes

Yes, Meta-Bind is an almost perfect solution, stumbled upon it myself, but great suggestion. This should be more native though. For example, this is meta-bind issue probably, but it uses toggles instead of checkboxes.

I like what the DataView plugin provides:
=this.myProperty

1 Like