[Neos] Creating custom NodeTypes: FlowQuery execution issues
Bernhard Schmitt
himself at nezaniel.org
Tue Apr 15 08:52:48 CEST 2014
Hi there,
I've created a package for managing events as nodes in Neos, e.g. for use in a calendar. For the "Event List" and "Upcoming Event" NodeTypes, I've set up the yaml:
'CORE4.EventBase:EventAggregator':
abstract: true
properties:
restrictToDocument:
type: boolean
ui:
label: 'Restrict to Document'
reloadIfChanged: TRUE
inspector:
group: 'aggregator'
ui:
inspector:
groups:
aggregator:
label: 'Aggregator options'
position: 10
'CORE4.EventBase:EventList':
superTypes:
- 'TYPO3.Neos:Content'
- 'CORE4.EventBase:EventAggregator'
ui:
label: 'Event List'
group: 'event'
inspector:
groups:
aggregator:
label: 'Event List options'
'CORE4.EventBase:UpcomingEvent':
superTypes:
- 'TYPO3.Neos:Content'
- 'CORE4.EventBase:EventAggregator'
ui:
label: 'Upcoming Event'
group: 'event'
inspector:
groups:
aggregator:
label: 'Upcoming Event options'
The corresponding ts2 looks like this:
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}
}
prototype(CORE4.EventBase:UpcomingEvent) >
prototype(CORE4.EventBase:UpcomingEvent) < prototype(TYPO3.Neos:Content) {
templatePath = 'resource://CORE4.EventBase/Private/Templates/NodeTypes/UpcomingEvent.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}
}
So much for the setup.
Now to my problem: While the EventList works just fine, the UpcomingEvent seems to simply not execute the find() part of the FlowQuery statement, i.e. the events variable results to a FlowQuery containing the startNode alone.
Is this some kind of weird bug or did I get something conceptually wrong?
More information about the Neos
mailing list