vrtmrz / obsidian-tagfolder

MIT License
221 stars 17 forks source link

FR: Support for Front-Matter-Title Plugin #25

Closed racy2020 closed 2 years ago

racy2020 commented 2 years ago

This plugin is so good, but it doesn't support the front-matter-title which replaces the filename with the value of a specified field in native explorer and graph view. When I use the plugin to browse my notes, the title becomes unreadable, because my notes use 'utc' or 'uid' as filename, and the real title is the aliases filed.

Thank you for creating the plugin!

vrtmrz commented 2 years ago

@racy2020 Thanks for your advice! I have implemented it! But it does not watch the changes in the frontmatter or headings. Once the metadata is changed, the title will be changed as well. Could you please try v0.11.0?

racy2020 commented 2 years ago

I tried the new version v0.11.0 , but it no longer works... 😔 OS: Win10 Obsidian Version: v0.15.9

123

vrtmrz commented 2 years ago

I could not reproduce it but fixed some specious points. (and fixes bugs about configuration). I'm sorry for your inconvenience but could you try v0.12.0 again?

racy2020 commented 2 years ago

This problem still exists in the new version ( v0.12.0 ), and it also appears when I try to run it on Linux.

I can avoid this problem (or bug? ) by changing the options ("order method ( tags )" and "order method ( items )"). It bypasses the function 'localeCompare( )' in source code.

I'm not very good at JavaScript. But if I have any new findings about this situation, I'll report to you again.

racy2020 commented 2 years ago

Returning to the topic, I am very grateful that this FR has been implemented! But I hope that the frontmatter field can be selected (instead of the only default "title"), similar to the Front-Matter-Title plugin.

vrtmrz commented 2 years ago

@racy2020 Thank you for testing! I implemented the feature that customizable the frontmatter path. And added a workaround for localeCompare (even still I am not sure). Would you mind checking again?

racy2020 commented 2 years ago

This bug has been fixed in the new version. And now it can select any filed as displaying-name. Thank you! Finally, I hope you can make a small improvement that it can choose to display only the displaying-name[0] ( the first string of displaying-name list ) instead of all of the displaying-name list. Because some notes have lots of aliases, if all of them are displayed it will be difficult to read. Thank you again for developing this plugin!

joellti commented 1 year ago

@vrtmrz The latest Obsidian insider version introduced Properties feature, it has a side effect related to this plugin. Right now in the plugin setting I enabled to use Front Matter property alias as note title. However, the Obsidian Properties feature blindly converts all alias to aliases and the latter is actually a list. Consequently, notes with alias originally now stop showing the titles in Tag Folder pane. I tried to change the plugin setting to use aliases as note title, but that brings to the issue discussed here, now all the aliases are shown as the note title, separated by comma, which is not what i want. So I think ideally the plugin could implement the same approach as in Front Matter Title as far as how to deal with a property of List values. Hope that's something you would consider. Thank you a lot.