Background: I have dark mode for panel nearly done, but it’s quite basic/hacky, so I thought I’d turn it on only for myself in the panel, but I’m not sure how to set it up so every user had their own toggle to turn it on or off.
Config page which somehow checks user and some sort of datastore - that seems complicated.
Is there a system for per user configiguration for plugins?
config.php for global pref
- read user bluprint/file for per user pref
ready() in config.php to set in memory pref to user’s if they don’t match
So in any case, I do have to add it manually to the user blueprint? There’s no in-built system for “this plugin needs these options from users”?
You should also be able to get the current user settings in your plugin.
Allright! I had hoped for some magical
$kirby->configurable('boolean'), but this works as well
No wait, I just realized a problem; if I want to share the plugin with the world, not only do the developer have to add the config to their user blueprints, but also it has to be specifically named, right?
So if you for instance wanted to use it, you’d download it and have to add “stupidDarkModeToggle” to your blueprints?
If you want to do it based on user settings, then yes, this setting would’ve to be added to each user blueprints. Not really a plug&play solution…
Damn, that’s not superuserfriendly.
I sort of hoped to be handwave the limitations with “turn it on only for yourself”
Maybe with the janitor button