Cannot use {{title}} in frontmatter?

Things I have tried

What I’m trying to do

I have the following frontmatter at the beginning of a note:

---
name: {{title}}
wildpflanze: ja
tee: ja
tags: wildpflanze, tee, herz
---

The tags do however not appear in the tag pane or in the graph view.

if I remove the title variable, they appear immediately.

Is it not allowed to use these in the frontmatter?

The {{title}} is used to write a template with the core Templates plugin. If you make a new note based on that template, Templates should fill in the actual new note title there, and then the new note will no longer have the issue.

On the other hand if you wish the tags on the template note itself to show up in the graph, you’ll have to figure out how to make the YAML syntax correct. I do not know for sure how to do this.
One thing to try might be putting [ ] around your list of tags, per the formatting suggestions in the Obsidian Help.
tags: [ wildpflanze, tee, herz ]

Good luck!

Hi @scholarInTraining

thanks for your help. Yes, it was a draft for a template. I’m trying to figure out how to transfer my notes from RemNote in a way that I can query them later with dataview.
I’ll remove the {{title}} in the frontmatter then.

The [ ] brackets are not needed around the tags, I tried both.

However, this formatting does NOT work - the tags won’t appear in the tag pane or the graph view:

---
alias:
tags: 
	- familie
	- erinnerung
	- persönlich
	- vorbild
---
1 Like

That is surprising to me about the tags! I only use the single-line syntax for frontmatter tags, though, so I do not know why. @CawlinTeffid or @Craig might know why your one-per-line frontmatter tag formatting is not getting picked up by graph or tag pane?

I don’t use that formatting, but if I remember correctly I think you have to manually add two spaces before the - instead of using a 4 space tab. It’s worth a try.

Good luck!

2 Likes

@I-d-as Yes you are right, it works when I use two spaces. I was using a tab before with 4 spaces. Now I deactivated the “use tabs” setting and set the tab size to 2 spaces and it works.

I’m so impressed by the response and help I get in this forum! Thanks for helping a newbie like me.

1 Like

I agree! This forum is really a great place to learn.

If you wanted to keep your 4 space tab setting as it was, you would just have to remember to add the two spaces for the first tag. Then, each time you press return for a new line after adding a tag it will automatically add the two spaces, the dash, then the space.

Another option would be to create a template for the word tags:, the new line, the two spaces, the dash, and the space. Then you could use the Hotkeys for templates plugin to automatically add the correct text. Yet another option is to look into using a free program like AutoHotkey on Windows or Keyboard Maestro on Mac. Someone here on the forum kindly introduced me to AHK a while back and it has helped me in countless ways.

Good luck and welcome!

2 Likes

The requirement to use spaces and not tabs is an unfortunate feature of YAML, the markup language used in Obsidian’s metadata sections (and those of many other Markdown-using apps).

3 Likes

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