Inline Frontmatter

I am trying to do up some notes for school and I want to create a table using Dataview to group different properties so I can refer easily when I go back to study. However, for the period of time using Dataview, I learnt YAML can be only created at the very top of the page in Obsidian.

Currently, I have different headings within the exact same page, and I was wondering if:

  1. I am able to create individual inline frontmatter metadata for the different headings
  2. Dataview will be able to detect these metadata that are inline, or does it only detect metadata that appear at the very top of the page?

Thank you for the help. I am still new to Frontmatter and Dataview, so any form of assistance is greatly appreciated! :grinning_face_with_smiling_eyes:

Dataview can read data (1) either from the YAML front matter, which as far as I know has to be on the top (between ---'s), OR from inline fields, which have the key:: value format, and can be anywhere in the text.
So, you can use inline fields wherever you want – just make sure you format it right (so, while you would put subject: history in the YAML, you need to put subject:: history if it’s inline).

Besides what @atiz said, I just add this:

  1. Full-line inline fields - Fields alone in full line. This is the best option if you want a more complex as a text. For example:

This is the book title

summary:: This is my summary or abstract. With an full inline field I can write a small or long paragraph. The field content stops when I break/change the line.

Now the content of my note…


  1. Inline Fields - fields inserted anywhere (for example inside the text or a task). This is the best solution for short key:: value (similar to tags) and can be used with two different syntaxes (the differences between the two resides in the way they are rendered in preview mode - need to try to see the differences in parallel with the new dataview setting “Enable Inline Field Highlighting”): [key:: value] or (Key:: value].
    Example:

This is the book title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. [topic:: kingdom] Integer aliquet eu nibh sed pharetra. Praesent sit amet magna (subject:: King Lion) vel lacus condimentum finibus id ac quam.


5 Likes

Thank you for the advice and guidance! Appreciate it a lot!

I would like to ask too, in this case since inline YAML pertains to a single line, does that mean I will need to replicate the entire line multiple times if I for example would like to have multiple points for one metadata?

How to add multiple values to inline-fields?
Multiple values (a list) is possible in inline-fields if you repeat the field. For example:

This is the book title

key:: this is my first value

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer aliquet eu nibh sed pharetra. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer aliquet eu nibh sed pharetra.

key:: this is my second value

Aenean eu magna vel nulla vulputate faucibus. Suspendisse laoreet et est eu dapibus. Sed hendrerit lorem tristique sapien vestibulum congue. Nulla facilisi. [key:: this is my third value] Integer id sollicitudin lorem. Integer egestas porta mauris, nec condimentum enim sodales quis.

This is equivalent to:

key:
  - this is my first value
  - this is my second value
  - this is my third value
2 Likes

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