Feature #70036
closedFluid: Custom fallback if partial is not available
Added by Arne-Kolja Bachstein about 9 years ago. Updated about 6 years ago.
100%
Description
In Extbase I have a scenario where I have to define partials based on an element type. If the partial is not available, it has to fall back to a default partial.
Imagine the following:
There are categories and items for this category. The detail view of a category's items should be based on the category. So I have the following detail template:
<h1>{item.name}</h1> <h2>Block 1</h2> <f:render partial="Category/[CategoryIDorName]/DetailBlock1" /> <h2>Block 2</h2> <f:render partial="Category/[CategoryIDorName]/DetailBlock2" />
Because there are some categories that share a default setup and some that are different from the others, I would like to have the following:
<h1>{item.name}</h1> <h2>Block 1</h2> <f:render partial="Category/[CategoryIDorName]/DetailBlock1" fallback="Category/Default/DetailBlock1" /> <h2>Block 2</h2> <f:render partial="Category/[CategoryIDorName]/DetailBlock2" fallback="Category/Default/DetailBlock2" />
This cannot be solved by the existing path overlay feature, as it would try to get the partial from a folder with the same name.
Currently I solved this by using a custom ViewHelper, wrapped in an if-statement:
<f:if condition="{krbu:PartialExists(partial: 'Category/{item.id}/DetailBlock1')}"> <f:then><f:render partial="Category/{item.id}/DetailBlock1" arguments="{_all}" /></f:then> <f:else><f:render partial="Category/Default/DetailBlock1" arguments="{_all}" /></f:else> </f:if>
But I think, that adding a simple fallback argument to the existing render ViewHelper would be the cleanest solution and I think, this might be of use for a lot of implementers.
Unfortunately I could not understand the view/partial flow very good yet without moderation, so I wasn't able to just create a patch for it.
Updated by Claus Due about 9 years ago
The "easy" marker in complexity is a bit misleading, but I digress ;)
There is one way you can do this currently but it only works for sections, not partials:
<f:alias map="{myVar: '{f:render(section: \'SectionName\')}'}"> <f:if condition="{myVar}"> <f:else><f:render section="Fallback" /></f:else> </f:if> </f:alias>
And once standalone Fluid is integrated in TYPO3, thanks to two new features:
1. Partials can now be rendered as `optional` like sections could before.
2. When an optional section or partial doesn't render anything, the tag content of <f:render> is rendered instead.
Because of this, you can soon do:
<f:render partial="MyPartial" optional="1"> <f:render partial="MyOtherPartial" optional="1"> <f:render partial="Fallback" /> </f:render> <f/render>
...and keep going to any depth you desire, use anything as fallback rendering.
I'm guessing this issue can be closed ;)
Updated by Gerrit Code Review about 9 years ago
- Status changed from New to Under Review
Patch set 37 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 38 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 39 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 40 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 41 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 42 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 43 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 44 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 45 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 46 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 47 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 48 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 49 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 50 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 51 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 52 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 53 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review about 9 years ago
Patch set 54 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 55 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 56 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 57 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 58 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 59 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 60 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 61 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 62 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 63 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 64 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 65 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 66 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 67 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 68 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 69 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 70 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 71 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 72 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 73 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 74 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 75 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 76 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 77 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 78 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 79 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 80 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 81 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 82 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 83 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 84 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 85 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 86 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 87 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 88 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 89 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 90 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 91 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 92 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 93 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 94 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 95 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 96 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 97 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 98 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 99 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 100 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 101 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 102 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 103 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 104 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 105 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 106 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 107 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 108 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 109 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 110 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 111 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 112 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 113 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 114 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 115 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 116 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 117 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 118 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 119 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 120 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 121 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 122 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 123 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 124 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 125 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 126 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 127 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 128 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 129 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 130 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Gerrit Code Review almost 9 years ago
Patch set 131 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/42425
Updated by Anonymous almost 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8b693daac0cc381f10c74bc5d78b2448f55111f3.