[FEATURE] Add inheritance mode control #2161
Merged
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.
Adds an extension configuration option and corresponding Form option and option ViewHelper which allows a site to control how Flux handles inheritance of FlexForm values (specific to pages).
Normally, Flux will only allow FlexForm values to be inherited from a parent page to children if the child uses the same page layout (template) as the parent page(s). This new option allows changing this inheritance mode from the default "restricted" to an "unrestricted" mode which allows FlexForm values to be inherited even if the child and parent uses different page layouts.
This is useful when you have different page templates which use the same FlexForm fields (for example, a shared set of fields) and you wish to inherit such fields from parents even if you use different page layouts on the child/parent(s).
There is a similar Form option which allows setting this inheritance mode on a per-template basis. Use the new ViewHelper flux:form.option.inheritanceMode for this, with either "restricted" or "unrestricted" as value. If no mode is specified on a template then the inheritance mode defined in extension configuration will be used.