Add support for toolbars in file-less views #556
Replies: 4 comments
-
|
@gertjanstulp Thanks for the suggestion, and code! Let me investigate that plugin, but I should be able to extend the projects view to support an empty view toolbar, in the near term, basically using your change. (Going beyond that to map other types of toolbars to other empty views not in that list will not be supported, but is on the roadmap.) For my reference: |
Beta Was this translation helpful? Give feedback.
-
|
That would definitely work for me. |
Beta Was this translation helpful? Give feedback.
-
|
@gertjanstulp Buttons now work in the Projects tab. As you tried before, just add The switch statement was the key here, as you discovered. It both fixes your issue, and expands the number of plugins that toolbars can be used in. Thanks for the suggestion/issue! |
Beta Was this translation helpful? Give feedback.
-
|
I just checked and it works perfectly. Thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Some custom plugins like https://github.com/obsmd-projects/obsidian-projects can show views/tabs without opening a file. I wanted to show a toolbar in the Projects tab shown by the obsidian-projects plugin. I've added the viewtype for the obsidian-projects view to the 'Other data types' field in the 'File types' config section, and configured a fab that's set as the default toolbar. When I open up the Projects tab the fab is rendered, but after clicking it nothing happens. I kind of understand as there's no active file when the Projects tab is shown and the 'File types' sections is specifically about files, but I was still curious if I could make it work somehow. As a test, I added the 'obsidian-projects' viewtype to the switch-case statement in the getEmptyViewToolbar method in SettingsManager.ts, and deployed to my local vault. This fixed the issue, as-in a menu is shown when I click the fab. I understand that that's not a proper fix, but it does demonstrate that the notes-toolbar plugin could work for file-less views. I would really appreciate it if support could be added for these kind of views.
Beta Was this translation helpful? Give feedback.
All reactions