Frontmatter confusion - For plugins only and yet plugins require the data

I’m so confused.
When the frontmatter feature first came out we got instructions about how to include aliases and tags. So I added that info to my notes (and it took a good long while).

Then in most of the frontmatter posts, it makes it quite clear that we should not include data in there, that it is exclusively for plugins. So I removed it from all my notes (and it took a good long while).

Now I want to use the DataView plugin, and it gets a lot of its information from the frontmatter. It doesn’t create the frontmatter; it reads it and works with it.

But no one is going to create that frontmatter for me, so I have to do it. But I’m not supposed to.

Help!

3 Likes

Hi Lise,

Let me clarify. There are a few confusing points at play.

  1. Some users had the expectation that the YAML metadata is also parsed by our link engine in search for linked or unlinked mentions. This does not happen. So if you put text there, obsidian ignores it for the purpose of linking and even search.

  2. The medata HAS to be in a very specific format and if you make a mistake, it won’t work at all.

  3. Since YAML is rigid, we had the idea of having the user input their data not manually (which is prone to error) but with a GUI. Neither us nor the plugin authors got to the point of writing GUIs to let user input their metadata

That being said if know what you doing and undestand the limitations/complications, go ahead:

Some relevant links
https://help.obsidian.md/Advanced+topics/YAML+front+matter

2 Likes

@WhiteNoise, thanks for the clarification.

About tags in frontmatter. I could swear that Obsidian was reading them properly as tags when entered as tags: ["#tag1", "#tag2"] but I just checked and they do not appear in the tag pane; nor do tags entered as `tags: [#tag1, #tag2]’ (the difference being that the latter actually auto complete).

But I guess that was your point: that anything entered in the frontmatter (except for alias) isn’t recognized by Obsidian per se (for now at least), and even if it is, we should not count on it.

This should appear in the tag pane. Autocomplete in YAML never worked.

I get your frustration. Things have changed a lot with certain parts in Obsidian. I guess that’s the cost of joining earlier, however I hope you still find it worth it.

But I feel your pain, I’ve done so much manual work reformatting so many aspects of my system.

I decided to not go for tags in metadata personally, since I like the autosuggestion, but since I have notes that do have tags in metadata, those should be read in the tag pane, if it’s not showing there could be a bug perhaps.

Best of luck

Your first example is wrong, there is no quotatations for fmtag2.
This makes the whole YAML block invalid.

it’s either
tag: [tag1,tag2]
or
tag: ["#tag1","#tag2"]

Perfect! So tags do still work in Frontmatter. Sorry about this then. I thought I tested them correctly (with all “#” like I’ve been using) and they weren’t showing up in tag pane or search. I must have done something wrong somewhere.

@santi Thanks. No, it was just me being an idiot. There is no bug.

I am still trying to figure out if I should put tags in frontmatter for future plugins, but I’m starting to think they are best used in the files themselves. I mean plug-ins will presumably always be able to find them there, so I could leave frontmatter for other stuff like date created. And I can always hide some tags I don’t want published or displayed in preview with <!-- -->. I think they are still seachable when there.

1 Like

yeah I would advice to just have your tags in the note as normal #tag at least that’s what I do.
Good luck!