Skip to content

Instantly share code, notes, and snippets.

View nezaniel's full-sized avatar

Bernhard Schmitt nezaniel

View GitHub Profile
@override.searchResults = ${this.sortedSearchQuery.limit(20).execute()}
@override.zipLocation = ${request.arguments.zipCode ? Location.fromGermanPostalCode(request.arguments.zipCode) : NULL}
zipLocation = ${zipLocation}
searchQuery = ${Search.query(site).nodeType('ACME:ACME')}
sortedSearchQuery = ${this.searchQuery.sortGeoDistanceAsc('location', Location.latitude(this.zipLocation), Location.longitude(this.zipLocation), 'km')}
@nezaniel
nezaniel / gist:22da6b211fd9cdd1af84
Created September 5, 2014 13:18
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}
}
prototype(CORE4.EventBase:Event) >
prototype(CORE4.EventBase:Event) < prototype(TYPO3.Neos:Page) {
body {
templatePath = 'resource://CORE4.EventBase/Private/Templates/NodeTypes/Event.html'
sectionName = 'body'
content {
images = ContentCollection {
nodePath = 'images'
}
description = PrimaryContent {
prototype(CORE4.EventBase:EventList) >
prototype(CORE4.EventBase:EventList) < prototype(TYPO3.Neos:Content) {
templatePath = 'resource://CORE4.EventBase/Private/Templates/NodeTypes/EventList.html'
startNode = ${q(node).property('restrictToDocument') ? q(documentNode) : q(site)}
events = ${this.startNode.find('[instanceof CORE4.EventBase:Event]').future().orderEventsByDate('asc')}
hasEvents = ${this.events.count() > 0}
}
'CORE4.EventBase:EventAggregator':
abstract: true
properties:
restrictToDocument:
type: boolean
ui:
label: 'Restrict to Document'
reloadIfChanged: TRUE
inspector:
group: 'aggregator'
'CORE4.EventBase:Schema.Event':
abstract: TRUE
ui:
icon: 'icon-calendar'
inspector:
groups:
event:
label: 'Event'
position: 50
visibility: