obsidian-front-matter-title icon indicating copy to clipboard operation
obsidian-front-matter-title copied to clipboard

Render title in links

Open carugnom opened this issue 2 years ago • 8 comments

The setting options of the plugin shows an 'File Note Link', which suggest (to me) the idea that links could render the title of the note, instead of its filename.

If that's the idea, I think it's not working. For me, links keeps rendering the filename Everything else is working or rendering as expected (Header title, Explorer title, Graph title, Quick switcher)

carugnom avatar Sep 25 '22 12:09 carugnom

@carugnom Hi, thank you for the feedback. Could you give me some screenshots? This option has to replace aliases of links if enabled. Also by default it replaces links without aliases, but you can change this behavoiur.

https://user-images.githubusercontent.com/3987716/192144983-36cc3739-bcfe-4310-a8a7-de2f7265df45.mp4

snezhig avatar Sep 25 '22 13:09 snezhig

@Snezhig thank you for the quick reponse My intention is to do something like this imagen Just specify a 'title' key in the frontmatter, and have the link rendering that name This examples is... I've created a note with 'testing-obsidian-front-matter' as the filename In the front matter I've specified the title as 'XXX' As show in the screenshot, the note title (upper left) was update correctly to 'XXX' But when I create a link to itself, the rendered text is still 'testing-obsidian-front-matter' instead of 'XXX'

I hope the example is clear enough Cheers

carugnom avatar Sep 25 '22 13:09 carugnom

@carugnom yes, I got the idea. I though about this feature and I will try to add it, but after 0.16.* release, because it will bring some breaking changes.

snezhig avatar Sep 25 '22 14:09 snezhig

ok, but what was the 'File Note Link' option meant for ? 'File Note Link' really sounds to be that functionality, IMHO Additionally, what name would have that new option after the 0.16 release ? Thank you for the clarification... I (and many others) will be waiting for that behavior ;)

Thinking of it... would it handle notes with the same title ? That would be great to support ambiguations (ie: many notes titled 'data types' would exist across several contexts)

carugnom avatar Sep 25 '22 15:09 carugnom

It just will be a feature of File Note Link manager. Like the approve modal. May be I just make the changing logic as a separate feature too to give you some way to use the Manager (one of or both):

  1. To replace aliases of links
  2. To change suggested titles

Now the plugin has 1 feature for the Explorer Manager and for the File Note Link manager. изображение

About notes with the same titles. I think it will be like it works now if you have the same alias: изображение

snezhig avatar Sep 25 '22 16:09 snezhig

All that sounds good... thank you for the effort !!

carugnom avatar Sep 25 '22 23:09 carugnom

Maybe this plugin could be used as inspiration https://github.com/basham/obsidian-alias-from-heading

It creates a new alias (in the file cache, not in the file content) and makes the file title searchable by title.

gilmrjc avatar Oct 25 '22 09:10 gilmrjc

@gilmrjc I will check it. Thanks.

snezhig avatar Oct 25 '22 12:10 snezhig

@carugnom You can kind of workaround it when defining alias instead of title, and changing the template field in the plugin settings from title to alias.

I've noticed this plugin only displays the title, but if you try to link a note, or click on the note in the graph it creates a new note. It's most likely because the displayed title doesn't exist in the notes yet. If you define an alias, at least obisidian will understand the note already exists.

venikx avatar Nov 08 '22 22:11 venikx