Is there a way to show frontmatter in transclusions?

What I’m trying to do

I’m trying to get transclusions to show frontmatter. For example I’ve been recording the publication date, author, and URL of papers I read in frontmatter. I’d like to be able to keep recording this data in a structured way, but also not lose the usefulness of transclusions.

Things I have tried

Searched settings, Googled, searched this forum.

PS

Thanks for the help!

You’re very fast ending in kind of a catch 22 situation here, as normal transclusion don’t do frontmatter easily, and dataview don’t do embeds easily.

I think in an ideal world my take on this use case would be to create a dv.view(), and either let it just present the extra information, or also try to let it do the transclusion. In the first case, you’d end up with a dv.view() for extra information and an embed markup for the actual transclusion.

In the other variation you might end up with the embedding not being reliable, or the possible mishap of loosing the update when renaming files, and possibly other stuff related to graph view and various link panels.

If you don’t mind duplicated data, you could use dataview inline queries to display the frontmatter you want at the top of a file

`=this.file.frontmatter.pubdate`
`=this.file.frontmatter.author`
`=this.file.frontmatter.url`
***

You could add one for each of the pieces of data you want.

Thanks for the responses.

@holroy, could you elaborate on “dataview don’t do embeds easily”? My only experience with Dataview is using Dataview implicit fields for some things, so I may be missing the background to understand.

@mr_abomination, thanks, unfortunately in my situation I’m creating tons and tons of pages, having to duplicate data would be too much work.

I believe I misspoke. The data will not actually be duplicated, but it will appear so when you open it in live preview mode. Inline Dataview queries are very flexible.

Here is an example of what I mean

Live Preview

Transcluded

Source Mode
Obsidian_uCl3iLf5ot

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