-
Notifications
You must be signed in to change notification settings - Fork 93
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
Feature: slots #427
Comments
Perhaps easier implemented and understood if using <f:render partial="Something">
<f:variable name="arg1">Special value for arg1 variable</f:variable>
<f:variable name="arg2">Special value for arg2 variable</f:variable>
</f:render> The result being that in addition to, or instead of, assigning these variables only when rendering the content and then clearing them before actually rendering the partial or whatnot - the variables would be redirected to be collected as arguments for calling the partial. This could be implemented with very little effort (toggle set in ViewHelperVariableContainer by Bonus: it becomes excessively easy to declare long-winded, non-inline, HTML-carrying, not-escaped variables this way since this would work regardless of Bonus-bonus: we avoid known issues with recursive regexp in huge inline array expressions. |
PoC coming right up, actually. |
This patch allows you to define arguments that get passed to f:render by using f:variable in the tag contents. ```xml <f:render partial="Something"> <f:variable name="arg1">Special value for arg1 variable</f:variable> <f:variable name="arg2">Special value for arg2 variable</f:variable> </f:render> ``` Any argument specified with f:variable this way will override the argument of the same name if it was passed in the “arguments” array as well. The combined result will be used as variables for the sub-rendering call. References: TYPO3#427
This patch allows you to define arguments that get passed to f:render by using f:variable in the tag contents. ```xml <f:render partial="Something"> <f:variable name="arg1">Special value for arg1 variable</f:variable> <f:variable name="arg2">Special value for arg2 variable</f:variable> </f:render> ``` Any argument specified with f:variable this way will override the argument of the same name if it was passed in the “arguments” array as well. The combined result will be used as variables for the sub-rendering call. References: TYPO3#427
This patch allows you to define arguments that get passed to f:render by using f:variable in the tag contents. ```xml <f:render partial="Something"> <f:variable name="arg1">Special value for arg1 variable</f:variable> <f:variable name="arg2">Special value for arg2 variable</f:variable> </f:render> ``` Any argument specified with f:variable this way will override the argument of the same name if it was passed in the “arguments” array as well. The combined result will be used as variables for the sub-rendering call. References: TYPO3#427
This patch allows you to define arguments that get passed to f:render by using f:argument inside the tag contents. ```xml <f:render partial="Something"> <f:argument name="arg1">Special value for arg1 variable</f:argument> <f:argument name="arg2">Special value for arg2 variable</f:argument> </f:render> ``` Any argument specified with f:variable this way will override the argument of the same name if it was passed in the “arguments” array as well. The combined result will be used as variables for the sub-rendering call. References: TYPO3#427
This patch allows you to define arguments that get passed to f:render by using f:argument inside the tag contents. ```xml <f:render partial="Something"> <f:argument name="arg1">Special value for arg1 variable</f:argument> <f:argument name="arg2">Special value for arg2 variable</f:argument> </f:render> ``` Any argument specified with f:variable this way will override the argument of the same name if it was passed in the “arguments” array as well. The combined result will be used as variables for the sub-rendering call. References: TYPO3#427
Add a new `f:argument` viewhelper to be able to add arguments to a node by using `f:argument` as child node. Usage example: ``` <my:node> <f:argument name="content">Hello World</f:argument> </my:node> ``` The sequencer does now put validation errors into a stack so we are able to revalidate a node before it is closed but children have been parsed. So we can still show the initial problem if e.g. a required property was not defined. Resolves TYPO3#427
I've added an implementation for Fluid 3 in my pull request. Would be cool to get some feedback. |
Add a new `f:argument` viewhelper to be able to add arguments to a node by using `f:argument` as child node. Usage example: ``` <my:node> <f:argument name="content">Hello World</f:argument> </my:node> ``` The sequencer does now put validation errors into a stack so we are able to revalidate a node before it is closed but children have been parsed. So we can still show the initial problem if e.g. a required property was not defined. Resolves TYPO3#427
Hey. |
The
contentAs
argument provided by Fluid is very useful to pass arbitrary content as variable to a partial/section.However, this is limited to a single variable, if multiple pieces of content should be passed, one has to e.g. resort to doing inline
f:render
calls withinarguments
instead.A nice solution to this would be a system similar to Vue.js component slots.
Basic example
Example.html
template:Foo.html
partial:Named slots example
Example.html
template:BaseLayout.html
partial:If we stick to the same naming or use something like
argument
is up to discussion of course as is this feature in general.The text was updated successfully, but these errors were encountered: