Is there a way to insert note filename automatically in the note itself?
thanks
Is there a way to insert note filename automatically in the note itself?
thanks
This is what a frontmatter is good for.
Frontmatter is also called YAML or in Obsidian: Properties.
You can add the filename on file creation with Template (core) or Templater (plugin store) plugins.
Or you can install community plugin Linter and add the title = filename any time after file creation.
I am hoping they will add this to the properties plugin by default (or optionally):
With Dataview installed, this works:
`=this.file.name`
Im very noobish with Obsidian, just started learning/using it, so didn’t really understand your suggestions…
This is what a frontmatter is good for.
Frontmatter is also called YAML or in Obsidian: Properties.
I imagined by Obsidian: Properties you meant obsidian > ctrl+p > type Obsidian: Properties but nothing appears?
You can add the filename on file creation with Template (core) or Templater (plugin store) plugins.
What are the steps exactly needed to do what you suggesting?
Or you can install the community plugin Linter and add the title = filename any time after file creation.
I was able to see this via obsidian > settings > community plugins, but then after opening its wiki help page to understand a bit better what it can do, I really got perplexed with the amount of stuff, I’m sure its cool, but a normal user that just wants to insert the note filename, seems bit overwhelming?
thanks ~
You can preface your notes with metadata. You can put any kind of information in there, e.g.:
Potty-trained: true
In your case: Title: Xyz
Search the forum for frontmatter and YAML and look up Properties Help.
In the meantime, because you will need the Templater sooner or later, may I suggest watching the guide I mentioned here:
How to create new file using code snippet or script? - Help - Obsidian Forum
As for Linter, it is a community plugin. It has many settings and may look overwhelming at first so give yourself time. With Obsidian as well.
Thanks for the feedback, but still lost:
Can you please share links instead of writing in text your in-text suggestions, would be more simple and direct for me to get to the page(s) you mentioning.
Thanks ~
I suggest starting with the video. Give it time, let it sink.
I would suggest using templater (the community plugin), because you can just do way more with it.
The first thing you have to type on the templater note is a “- - -” (the three lines written together) which will activate the properties tab.
Then you have to add a property, name it what ever you want and add “<% tp.file.title%>” which will call the note title and add it.
The note name must be changed before activating your template.
After the activation you’ll have this.
I would recommend watching a templater basics video on youtube. Just look for obsidian templater basics, or something like that. There is a lot of good information out there.
Hope that helps
Use the Templates core plugin’s {{title}}
variable.
Also, in Linter, bottom of YAML section:
In a setting above, you can set the order in which the frontmatter keys are organized.
Then you can “Lint” whole folders and your complete vault. All files will be prefaced with this information.
Then you can add more keys – to be in keeping with the Obsidian Properties update, for example.
You cannot do much harm with it, but if you want to be careful, make backups of your vault before each re-lint.
Then, for the future, when creating new notes, you add in your template the necessary information, along with title.
Try to keep the Linter settings in line with the template. Otherwise, Linter will correct your file each time, provided you run the lint commands.
Can you give some examples how to utilize the information in the frontmatter? Commonly the use case is searching by property or using Dataview plugin. Later in the future there will be a core feature similar to Dataview, as stated in Obsidian Roadmap - Obsidian. It has to be said: these are advanced features and they potentially overlap with other powerful software such as task management, project management and spreadsheet software. One more time (to other readers, not gino_m): don’t plan to use search by property or Dataview unless you really know what you are going to do when interacting with your second brain (your notes system).
To easily access frontmatter information while typing: currently there are no obvious solution to this. One solution is Toggle Live Preview/Source mode
(enable source mode) and then press cmd + up and select the value that you want to copy. This is not very elegant solution so you could also use Properties view: Show file properties
and then left click on the right next to the value that you want to select and copy. Some values like tags and aliases are not selectable. There is some context menu when you left or right click property icon in the File properties but I’m not able to copy anything by using this context menu.
To gino_m:
What do you think if left clicking a tag or alias when editing property in File properties would make the tag/alias selectable? Although the editing process is an extra step if the user wants to copy the property value. There could be a copy icon next to values, similar to pen icon when hovering, but this isn’t easy solution because there could be multiple values in one property. I think edit + select would be bearable when copying property values.
Hard to generalize. Everyone uses custom information. The commonly used keys are catered to by Obsidian to set standards for developers and users alike.
As for editing, I expect this Properties feature will be a topic for a while and the ripples will cease as we go on to new perspectives – mentioned by you as well.
Linter is an actively maintained great plugin and will probably be a preferred choice to do property janitor jobs.
Personally, I don’t mind learning what Obsidian expects me to and the workarounds.
Thanks for the suggestion.
I was able to understand what templates are:
But… if rename note, the templated inserted note title/filename isn’t updated.
In fact, clicking on it, i see its plain text, so no special characters to support it would be dynamic thing.
Interesting how a text editor/notes taking misses basic text editor capacities… oh well it is what it is… time to check all other surely exotic workarounds for this basic missing feature.
Yeah, it just inserts the name. The question didn’t mention updating.
That doesn’t strike me as a basic…I would guess more text editors lack this feature than have it.
(…)To easily access frontmatter information while typing: currently there are no obvious solution to this. One solution is
Toggle Live Preview/Source mode
(enable source mode) and then press cmd + up and select the value that you want to copy. This is not very elegant solution so you could also useProperties view: Show file properties
and then left click on the right next to the value that you want to select and copy.(…)
Thanks for the suggestion, so frontmatter allows us to add key=values section on note start
But its empty, so I don’t see any note tile, which is what I’m trying to understand how to add:
Thanks for the suggestion, so I installed and enabled community plugin Templater, but when:
I type - - - nothing appears no my note (supposedly some properties key/value like in your screenshot?
So I tried putting <% tp.file.title%> as Frontmatter aliases and directly on the note but no luck, it just displays <% tp.file.title%>
Putting aside Templates or Templater for a moment, in a note at line 1, typing ---
will bring up the Properties view interface. If there already is opening and closing ---
s or YAML in your note, you’ll see the Properties view UI already if you haven’t changed the Editor -> Properties in document
options. From here, you can type in any names(keys) and values you’d like.
You can verify what’s in the top your note by switching to Source mode
(three vertical dots menu in the top right of your note, the lower Status Bar switcher button, or command).
I’m not at a computer right now, but I think the problem is that you use alias as a properties type. You can change the type by right clicking the icon. (The bent arrow in your case.) Make sure the icon is the three lines.
However, putting <℅tp.file.title%> inside you’re note should work witb no problem…
I thank everyone’s suggestions, but I still don’t know the answer to my post question, “How to dynamically insert note filename”.
I tried feedback with animated gifs to everyone (hope I didn’t miss anyone), showing me failing to follow suggestions.
So in layman’s terms, can anyone just write a list of steps and/or clicks I need to do ? Please avoid paragraphs mentioning dozens of plugins or discussions of advanced stuff.
I just want to:
Thanks in advance ~
PS. Now out of topic, I managed to learn to use synching It was great I got obsidian in all my computers and devices, but… had some trouble understanding as some things are not easy to understand, but after a small folder of example of files I managed to understand rules to only sync the file extensions I need, which is amazing, as I’m only interested in .md and /jpg, .png and .xlsx for now, the good thing is with sync filter I don’t have to lost days/weeks reorganizing my legacy folders structure full of all type of file extensions.
If there’s a topic on synching on this forum, I may share easy steps and insights for anyone to follow.
The default note Properties don’t include filename
or title
. You need to issue a Feature Request for that.
If a note gets renamed, you need to use Linter to update the title (the key’s name is title, not filename) manually.