How to refer to another file's frontmatter? #299
Unanswered
ethan-harvey
asked this question in
Help
Replies: 2 comments 2 replies
-
You can use Dataview's API for this. Can also do in templates but would have to parse the file manually. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Somebody came up with a nice method for doing this here: #1001 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I'm running a template from one file, how can I get and use another file's frontmatter?
I want to create a list of files with headings that match the current file's title. Each of the files has the frontmatter key "time:" which I want to prepend to the file link and then use to sort the list. For example, if I'm running the template in a file named "2021-07-31.md", I want the list to look like this:
I could use the Dataview plugin for this, but I'd like to be able to see the list in Edit mode and when I open the file with a different text editor.
(Alternatively, can I use the results of a Dataview query in a template?)
Beta Was this translation helpful? Give feedback.
All reactions