-
Notifications
You must be signed in to change notification settings - Fork 101
[FEATURE] Named Slots #1118
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
base: main
Are you sure you want to change the base?
[FEATURE] Named Slots #1118
Conversation
6fb787a
to
e40ff6d
Compare
This patch enables Fluid's components to accept multiple slots. Each slot is identified by a `name` argument. The corresponding `<f:fragment>` ViewHelper can then be used to fill the slots of a component. The available slots of a component are now also exposed properly via the `ComponentDefinition` DTO. Unfortunately, the `TemplateParser` fails to propagate available slots of the current templates consistently to the `ParsingState`, which currently leads to ugly state merging within the parser. Hopefully, this issue can be addressed in the future to remove this workaround, which has been documented in the code. For this first implementation, we limit the usage if the new `<f:fragment>` ViewHelper to the context of components. However, we might expand this ViewHelper to other areas in Fluid, such as a way to partially extend/overwrite templates.
Possible Validations:
|
TBD: |
Since f:fragment might be useful in other contexts later, it's probably better to use the more generic |
Unfortunately, this would be a breaking change:
I've created issue #1134 with the "breaking" label.
I don't think that we should do that. |
This patch enables Fluid's components to accept multiple slots. Each
slot is identified by a
name
argument. The corresponding<f:fragment>
ViewHelper can then be used to fill the slots of acomponent.
The available slots of a component are now also exposed properly
via the
ComponentDefinition
DTO. Unfortunately, theTemplateParser
fails to propagate available slots of the current templates consistently to
the
ParsingState
, which currently leads to ugly state merging within theparser. Hopefully, this issue can be addressed in the future to remove this
workaround, which has been documented in the code.
For this first implementation, we limit the usage if the new
<f:fragment>
ViewHelper to the context of components. However, wemight expand this ViewHelper to other areas in Fluid, such as a way to
partially extend/overwrite templates.
Resolves: #1109