Conversation
|
Don't really understand the use case. Can you show a screenshot of how you're actually using this? |
|
Hey @jasonvarga I'm working on an addon that needs a bit more context on the Sets of a Replicator. An addon can already add it's own "config fields" with Here's a screenshot.
|
|
And what do you do with the editorial settings once you've filled them out? |
|
Could one not ask the same for the Fieldtype "config fields" that we already have? The "Editorial settings" was just an example for the screenshot. To keep that example going, the addon in this case could be some UI extending the Replicator/Sets. Could also be something that's run on the server where it just needs more context for the Sets. I guess it could just be some "hidden fields" inside the Set itself, but that's not as clean for this use case. Essentially just a way to add some arbitrary "meta data" to Sets, that's also editable from the CP. |
|
The two examples you're mentioning, of how config fields are being used, are both for "custom behavior". An addon can create any custom fields it needs for any Fieldtype, for whatever reason it needs. Your suggested replacement for Sets with Maybe my screenshot example was bad. Imagine you have a "page builder" with a Replicator with many Sets (page sections). Very common I guess. |



Addons can append fieldtype configuration, but cannot add fields to the Edit Set stack in Replicator or Bard. Custom set metadata added in YAML is also discarded when a field is saved through the blueprint editor.
This adds
Sets::appendSetConfigField()andSets::appendSetConfigFields()for native fields in that stack. Values are stored alongside the set's existing configuration and pass through native preprocessing, validation, metadata loading, and processing. Nested fields are supported. Unregistered custom metadata survives a round trip, including when its addon is temporarily disabled. Reserved native keys cannot be registered or overwritten through the extra configuration values.Addresses statamic/ideas#1484. Documentation tracking: statamic/docs#1983. This is configuration on reusable set definitions, separate from content-instance settings discussed in #11720. The core change contains no addon-specific fields.
Validation:
6.xand a patch applied tov6.31.0.Draft for discussion of the API and persistence scope, and for further local hands-on testing. Compiled assets are omitted per the contribution guide.