Embed properties/frontmatter from a different note

Use case or problem

When using internal links to link to another note, you’re able to link to a specific heading in the note and display the content under the heading, and you’re able to link to and display a specific line in that note.
However, you’re not able to link to and display any specific frontmatter or tags in that note.
I’m building encounters for a D&D game and my monsters are all on their own notes. When I link those monsters into an encounter note, I would also like to automatically include the custom properties I’ve set such as AC and HP and average damage.

Proposed solution

Add an internal link option that can target frontmatter. If I had a kobold with a custom property of AC (that I had set to 12), then I could type something like [[kobold#$AC]], and in the note it would show something like ‘AC: 12’.

Current workaround (optional)

The Meta Bind plugin seems to be able to display frontmatter, but that plugin is for building calculators and buttons and dropdowns and is massive overkill for just ‘display a linked note’s property’.

1 Like

I changed “Link” in the title to “Embed”, because that’s what the kind of link that shows the linked content is called.

I think you could do this with a base that matches only the note you want to link. I don’t know much about using bases so can’t guide you, but here is the help page: Introduction to Bases - Obsidian Help.

An embedded search could potentially work too, specifying the exact note and the properties:

~~~query
File:/^dragon$/ ([hp] OR [ac])
~~~

The file operator is using a regular expression to match the exact file name. If there is >1 note with that name, you’ll need to use Path: instead and specify the folder path starting from the root of the vault: Path:/^RPG/Monsters/Dragon.md$.