Hi guys,
how can I exclude an element to render if no child for the current element exists?
In this case, a list with all clients gets rendered. But if the ClientRenderer has no latestVideoPoster it should be excluded from the list.
My approaches with @if didn’t worked so hope someone can help me.
Thank you!
prototype(Vendor:ClientList) < prototype(TYPO3.TypoScript:Collection) {
collection = ${q(site).find('[instanceof Vendor:Client][layout*="commercials"]').sort('title', 'ASC').get()}
itemName = 'node'
itemRenderer = Vendor:ClientRenderer
}
prototype(Vendor:ClientRenderer) < prototype(TYPO3.TypoScript:Template){
templatePath = 'resource://Vendor/Private/Templates/NodeTypes/IsotopeCommercialElement.html'
title = ${q(node).property('title')}
category = ${q(node).property('category')}
agent = ${q(node).property('agent')}
additionalCategories = ${q(node).property('additionalCategories')}
clientLink = TYPO3.Neos:NodeUri {
node = ${q(node).get(0)}
}
latestVideoPoster = Vendor:VideoPoster {
@context.node = ${q(node).children('[instanceof Vendor:Video]').sort('creationdatetime', 'DESC').get(0)}
}
}
prototype(Vendor:VideoPoster) < prototype(TYPO3.TypoScript:Template) {
templatePath = 'resource://Vendor/Private/Templates/NodeTypes/VideoPoster.html'
title = ${q(node).property('title')}
pictures = ${q(node).property('pictures')}
}