-
-
Notifications
You must be signed in to change notification settings - Fork 581
[6.x] Addons Settings + Control Panel page #11929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Excited for this one, its a big time saver. |
I've also added some handling around the situation where a repository's config array doesn't exist in the app's eloquent-driver.php. When it's not present, it'll find the array from the Eloquent Driver's base config, and append it to the bottom of the app's eloquent config.
Going to move the database side in the Eloquent Driver, to keep things consistent with everything else. It has the infrastructure (configs, import/export commands, migration helpers, etc) for handling database stuff.
Love to see this! Is it possible for the settings to be site-aware? This can be crucial for certain scenarios like SEO. |
We're not planning on making addon settings localisable I'm afraid, at least not right now. It would complicate things for the vast majority of addons who don't need site-specific settings. However, what you could do is create a custom publish form (we've simplified them in #11787) w/ the localizable fields, then use the flat file/database storage stuff provided by this PR. |
I understand.
What "flat file/database storage stuff" are you referring to? |
By default, addon settings will be stored as YAML files in So, if you need to build your own publish form, you could still use the flat file/database storage layer using the helpers provided by this PR, saving you from needing to build that part yourself. |
The $settings->values() getter/setter is removed in favor of `$settings->all()` as a getter and `$settings->set(array)` as a setter. The `set` method now works like `config()->set()` where if you pass an array as the first argument it will set the whole thing.
This pull request makes a bunch of changes to the Addons page in the Control Panel.
Addon Listing
Instead of being a not-very-good clone of the Marketplace, the addons index page will now simply list out your installed addons:
Unlisted addons have moved to this page, and will no longer be listed on the "Updates" page.
Addon Settings
This PR also makes it possible for addons to create their own settings pages by providing a "settings blueprint".
Settings blueprints can either be defined in an addon's service provider, or they can live in
resources/blueprints/settings.yaml
where they'll be automatically picked up.Configuration values, like URLs or API Keys can be referenced in addon settings using Antlers:
{{ config:app:url }}
Addons can then retrieve their settings via the
Addon
facade:By default, addon settings will be stored in YAML files in
resources/addons
. However, they can easily moved into the database usingphp please install:eloquent-driver
.Permissions
We now have two sets of addon-related permissions:
What's the difference between addon settings & config files?
Related: statamic/docs#1699
Related: statamic/eloquent-driver#469