-
Notifications
You must be signed in to change notification settings - Fork 43
[7.x] Localizable Site Defaults #436
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The AddonSettingsSaved event will do that for us.
…objects I wanted them to come from the blueprint instead, but spent too long fighting tests, so I'm gonna keep it the way it was.
Member
Author
|
Right now, when you switch localization and edit an inherited field, it won't be saved properly. It's a bug in Core, which I've opened a PR to address: statamic/cms#12830 Gonna merge this into |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request makes Site Defaults localizable, allowing fields to differ between sites (eg. Site Name, Google Verification Code).
CleanShot.2025-10-21.at.17.30.05.mp4
A localization will be created for each site. You can optionally configure an "origin" for each localization to inherit its values. Origins can be configured via a modal:
Storage
As part of SEO Pro 7, Site Defaults are being migrated to Statamic's new Addon Settings feature, which gives developers a choice between flat file and database storage for settings.
Localizations are stored as keys in the addon settings data:
SEO Pro will migrate your existing site defaults data into this format when you run
php please multisite.Note
While we're using the Addon Settings feature behind the scenes, we're not actually using the publish form it provides. The publish form is custom.
humans.txt
SEO Pro only registers one
humans.txtroute per domain.If you have multiple sites on the same domain, SEO Pro will use the defaults for the site on the root of the domain.
PHP API
If you call the
SiteDefaultsclass anywhere in your own code, you will need to update your usage.The
SiteDefaultsclass has been refactored to allow for localizations. Therefore, you need to get a localization before you can retrieve its values.If you listen to the
SiteDefaultsSavedevent (previously known asSeoProSiteDefaultsSaved), you may need to update your code as the$defaultsproperty is now an instance ofLocalizedSiteDefaults.Closes #289
Related: statamic/cms#12830