Skip to content

Instantly share code, notes, and snippets.

@pumatertion
Created May 4, 2014 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pumatertion/6c025a928597161bc543 to your computer and use it in GitHub Desktop.
Save pumatertion/6c025a928597161bc543 to your computer and use it in GitHub Desktop.
prototype(IVI.NodeTypes:Visuals) < prototype(TYPO3.TypoScript:Template){
templatePath = 'resource://IVI.NodeTypes/Private/Templates/NodeTypes/Carousel.html'
carouselItems = TYPO3.Neos:ContentCollection {
nodePath = 'visuals'
iterationName = 'carouselItemsIteration'
attributes.class = 'carousel-inner'
itemRenderer = TYPO3.Neos:ContentCase {
default {
@position = 'end'
condition = ${q(node).is('[instanceof TYPO3.Neos.NodeTypes:Image]')
type = ${q(node).property('_nodeType.name')}
}
}
}
// Enhance image prototype for the carousel
prototype(TYPO3.Neos.NodeTypes:Image) {
// Render images in the carousel with a special template.
templatePath = 'resource://IVI.NodeTypes/Private/Templates/TypoScriptObjects/CarouselItem.html'
attributes.class = ${'item' + (carouselItemsIteration.isFirst ? ' active' : '')}
// We want to use the item iterator in the template so we have to store it in ts.
iteration = ${carouselItemsIteration}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment