[Neos] Wrapping *each* children of ContentCollection with custom markup
Marcin Ryzycki
marcin at ryzycki.com
Thu Apr 24 19:35:01 CEST 2014
Hi Christopher,
Many thanks for that - before I saw your reply, I finally came up with
something like this (the previous version was causing problems in Neos
back-end, content-collection was unselectable and you could only add
new element via structure tree module):
prototype(M12.Foundation:BlockGrid) < prototype(M12.Foundation:Content) {
blockGridContent = TYPO3.Neos:ContentCollection {
nodePath = 'content'
itemName = 'gridNodeItem'
itemRenderer = M12.Foundation:BlockGridItem
}
}
prototype(M12.Foundation:BlockGridItem) < prototype(M12.Foundation:Content) {
blockGridItemContent = TYPO3.TypoScript:Collection {
collection = ${q(gridNodeItem)}
itemName = 'node'
itemRenderer = TYPO3.Neos:ContentCase
}
}
But... of course I like your version more ;-)
Thank!
M.
On 2014-04-20 07:23:30 pm +0000, Christopher Hlubek said:
> Hi everybody,
>
> good ideas already to solve this case!
>
> But what about using a processor on the itemRenderer of your
> "blockGridContent" and use the default ContentCollection?
>
> prototype(...) {
> blockGridContent = TYPO3.Neos:ContentCollection {
> nodePath = 'content'
>
> itemRenderer. at process.myWrapper = TYPO3.TypoScript:Template {
> templatePath = 'resource://MyPackage/Private/Templates/NodeTypes/Wrap.html'
> // Output the wrapped content with {value -> f:format.raw()} in the
> Fluid template
> value = ${value}
> }
> }
>
> Just had a quick test-drive with the demo site and this should work as
> expected. You could also just use an expression without a special Fluid
> template:
>
> prototype(...) {
> blockGridContent = TYPO3.Neos:ContentCollection {
> nodePath = 'content'
>
> itemRenderer. at process.myWrapper = ${'<li class="my-wrap">' + value +
> '</li>'}
> }
>
> Greetings,
>
> Christopher
More information about the Neos
mailing list