Skip to content

Instantly share code, notes, and snippets.

@nezaniel
Created September 5, 2014 13:18
Show Gist options
  • Save nezaniel/22da6b211fd9cdd1af84 to your computer and use it in GitHub Desktop.
Save nezaniel/22da6b211fd9cdd1af84 to your computer and use it in GitHub Desktop.
Attribute propagation in TS Prototypes
# Abstract Box
prototype(EA:Box) >
prototype(EA:Box) < prototype(TYPO3.Neos.NodeTypes:TextWithImage) {
targetNode = ${q(node).property('linkTarget')}
targetAudience = ${q(node).property('linkTarget')?q(this.targetNode).closest('[instanceof EA:TargetAudience]').get(0):NULL}
@override.targetAudienceIdentifier = ${q(node).property('linkTarget')?q(this.targetAudience).property('identifier'):'default'}
targetAudienceIdentifier = ${targetAudienceIdentifier}
attributes.class = ${'target-audience-' + targetAudienceIdentifier}
}
# Slide
prototype(EA:Slide) >
prototype(EA:Slide) < prototype(EA:Box) {
attributes.class = ${'item ' + attributes.class}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment