[Neos] Wrapping *each* children of ContentCollection with custom markup

Christopher Hlubek hlubek at networkteam.com
Sun Apr 20 21:23:30 CEST 2014


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

Am 18.04.2014 um 17:04 schrieb Marcin Ryzycki <marcin at ryzycki.com>:

> OK, solved!
> Thanks Pankaj for the suggestion with TYPO3.Neos:ContentCase.
> 
> Here's working code:
> 
> blockGridContent = TYPO3.TypoScript:Collection {
> 	collection = ${q(node).children('[instanceof TYPO3.Neos:ContentCollection]').children()}
> 	itemRenderer = M12.Foundation:BlockGridItem
> 	itemName = 'gridNodeItem'
> }
> 
> prototype(M12.Foundation:BlockGridItem) < prototype(M12.Foundation:Content) {
> 	blockGridItemContent = TYPO3.TypoScript:Collection {
> 		collection = ${q(gridNodeItem)}
> 		itemName = 'node'
> 		itemRenderer = TYPO3.Neos:ContentCase
> 	}
> }
> 
> And then <ts:render path="blockGridItemContent" /> inside BlockGridItem.html renders every child correctly.
> 
> Cheers!
> M.
> 
> 
> On 2014-04-18 01:34:13 pm +0000, Marcin Ryzycki said:
> 
>> On 2014-04-17 06:09:16 am +0000, Pankaj Lele said:
>>> try this one
>>> prototype(M12.Foundation:BlockGrid) < prototype(M12.Foundation:Content) {
>>> 	blockGridContent = TYPO3.TypoScript:Collection {
>>> 		collection = ${q(node).children('[instanceof TYPO3.Neos:ContentCollection]').children()}
>>> 		itemName = 'gridItem'
>>> 		itemRenderer = TYPO3.Neos:ContentCase
>>> 	}
>>> }
> 
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos



More information about the Neos mailing list