I am wondering if it is possible to create an internal link using a value stored in the YAML front matter of a page?
For example, if I have the author of a book stored in the front matter of a page, could I then use DQL to create an internal link using that front matter, something like:
Obviously this isn’t working, but hopefully it demonstrates what I am trying to achieve.
[[ do not seem to go well with the inline code. I believe I got something working with:
link expects the full path
link("path/to/" + this.Author) would be more correct. Obsidian seems to be smart about connecting links up with just the filename as long as you don’t have any notes with duplicate names in different folders of your vault!
Note 2: the one-liner DQL queries only render results in Reading View, not Live Preview, at the moment.
Thank you, this works well.
One observation is that is appears to create the page as well as linking to it, which isn’t typical behaviour. Is there a way round this?
It did not do so for me! I am on Obsidian 0.14.15 and the most up-to-date version of dataview (Settings → Community Plugins → Check for Updates button). I don’t see anything in the dataview settings that would cause this behavior, so I wonder if some other plugin is causing it. You could try disabling different plugins, restarting obsidian, testing if the behavior changed, re-enable the plugins and/or disable different ones, restart obsidian, test again, etc. (Key here is to restart Obsidian after you change your plugin configuration to make sure the changes have “stuck”.)
Will do! Thanks so much for the assist.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.