Feature #50801
Arguments "path" and "package" for f:layout View Helper
Added by Rafael Kähm almost 9 years ago.
Updated almost 9 years ago.
Description
This is usefull if you use multiple packages for the same application.
Make sure you use "package" argument for each VH that needs this argument inside used layout, because Fluid does not know "origin" (also where layout come from) and tries to fetch controller and action from package, which uses this layout.
Also next step is to implement Node-"origin" functionality and after that Arguments "path" and "package" for f:render View Helper (for Partials).
gerrit review comes tomorrow.
- Status changed from New to Under Review
- Status changed from Under Review to Needs Feedback
Hi Bastian; how would you do that with the patch you've mentioned?
Adrian Föder wrote:
Hi Bastian; how would you do that with the patch you've mentioned?
Create a Views.yaml and override the default layoutRootPath:
-
options:
layoutRootPath: 'resource://Some.Package/Private/Layouts'
If you only want to override it for certain packages/controllers/actions you can use the requestPattern configuration
Hi Bastian,
i see no opposites to using both patches for that. #50801 and #50826 are backward compatible to current Fluid and i think it is similarly compatible to #42176.
Hi Bastian again,
but still with Views.yaml you can only set the path, not the complete "url" to the file.
Consider a use case where you have a Neos Site Package and a plain Flow package and you want to cross-reference concrete partial files, for example, just to avoid duplicate template code.
Rafael Kähm wrote:
i see no opposites to using both patches for that.
The patches are compatible, yes. But we prefer a single way of configuration and I can't think of a scenario that is possible with this patch but not with the Views.yaml change
Adrian Föder wrote:
but still with Views.yaml you can only set the path, not the complete "url" to the file.
Of course:
-
requestFilter: 'isPackage("Original.Package") && isController("Foo") && isAction("bar")'
options:
partialPathAndFilenamePattern: 'resource://Some.Package/Private/Partials/Foo.html'
Or did I get you wrong?
I agree, setting "path"/"package" on the layout view helper is simpler for that use case. But with the views configuration we have one way of covering all sorts of scenarios.
- Status changed from Needs Feedback to On Hold
- Priority changed from Must have to Could have
Bastian, for the mentioned configuration you will force-overwrite the whole partial path and file name (you even don't make it a "pattern" but a fixed value), so, different partials along the same Action request won't be possible, no?
Hello <f:render partial="Party/NameAndIcon" />,
here's your map: <f:render partial="Party/LocationMap" />
won't this always result into 'resource://Some.Package/Private/Partials/Foo.html'
for both partials as configured in your example?
Adrian Föder wrote:
Bastian, for the mentioned configuration you will force-overwrite the whole partial path and file name
Yes, you're right. This probably makes more sense with layouts. However with the "Fallback path" feature (#39870) it should be possible to do something like:
-
requestFilter: 'isPackage("Original.Package") && isController("Foo") && isAction("bar")'
options:
partialRootPaths: ['resource://Some.Package/Private/Partials/', 'resource://Original.Package/Private/Partials/']
I really don't want to be too restrictive and maybe I'm missing something, but I really fear Fluid getting too complex (code and usage-wise). Let's see what others think about this
- Status changed from On Hold to Closed
- Assignee set to Bastian Waidelich
Closing in favor of #42176 (as discussed via IRC)
Also available in: Atom
PDF