Commit dd23b45e authored by Dominique Feyer's avatar Dominique Feyer
Browse files

TASK: EventList must be more flexible

parent 9ce0505e
......@@ -11,8 +11,8 @@ prototype(Ttree.News:Event) < prototype(Ttree.News:AbstractNews) {
venue = ${q(node).property('venue')}
startDate = ${q(node).property('startDate')}
endDate = ${q(node).property('endDate')}
@override.startDate = ${this.startDate}
@override.endDate = ${this.endDate}
@context.startDate = ${this.startDate}
@context.endDate = ${this.endDate}
dateFormatType = Ttree.News:DatePeriod
......@@ -39,4 +39,4 @@ prototype(TYPO3.Neos:PrimaryContent) {
condition = ${q(node).is('[instanceof Ttree.News:Event]')}
type = 'Ttree.News:Event'
}
}
\ No newline at end of file
}
......@@ -31,8 +31,7 @@ prototype(Ttree.News:AbstractList) < prototype(TYPO3.Neos:Content) {
paginationArgument = ${request.httpRequest.arguments['--news']['currentPage']}
}
entryTags {
1 = ${'Node_' + documentNode.identifier}
2 = ${'DescendantOf_' + documentNode.identifier}
1 = ${'NodeType_Ttree.News:AbstractNews'}
}
}
}
......@@ -53,4 +52,4 @@ root {
paginationArgument = ${request.httpRequest.arguments['--news']['currentPage']}
}
}
}
\ No newline at end of file
}
prototype(Ttree.News:AbstractNews) < prototype(TYPO3.Neos:Content) {
firstContentNode = ${q(node).children('main').find('[instanceof TYPO3.Neos.NodeTypes:Text]').get(0)}
@override.firstContentNode = ${this.firstContentNode}
@context.firstContentNode = ${this.firstContentNode}
firstContentNodeText = ${q(this.firstContentNode).property('text')}
@override.firstContentNodeText = ${this.firstContentNodeText}
@context.firstContentNodeText = ${this.firstContentNodeText}
title = ${q(node).property('title')}
teaser = ${this.firstContentNodeText ? this.firstContentNodeText : q(node).property('teaser')}
......@@ -18,4 +18,4 @@ prototype(Ttree.News:AbstractNews) < prototype(TYPO3.Neos:Content) {
uri = TYPO3.Neos:NodeUri {
node = ${node}
}
}
\ No newline at end of file
}
prototype(Ttree.News:AbstractEventList) < prototype(TYPO3.Neos:Content) {
storageNode = ${documentNode}
allEventCollection = ${q(this.storageNode).find('[instanceof Ttree.News:Event]').get()}
@context.allEventCollection = ${this.allEventCollection}
sortProperty = 'startDate'
@override.sortProperty = ${this.sortProperty}
numberOfItems = 1000
@override.numberOfItems = ${this.numberOfItems}
@context.sortProperty = ${this.sortProperty}
numberOfItems = 20
@context.numberOfItems = ${this.numberOfItems}
attributes {
class = 'list list-default'
......@@ -25,31 +30,21 @@ prototype(Ttree.News:AbstractEventList) < prototype(TYPO3.Neos:Content) {
@cache {
mode = 'cached'
maximumLifetime = '86400'
entryIdentifier {
node = ${documentNode}
node = ${node}
documentNode = ${documentNode}
paginationArgument = ${request.httpRequest.arguments['--event']['currentPage']}
editPreviewMode = ${documentNode.context.currentRenderingMode.name}
}
entryTags {
1 = ${'Node_' + documentNode.identifier}
2 = ${'DescendantOf_' + documentNode.identifier}
}
}
}
# Add paginationArgument to the page entryIdentifier
prototype(TYPO3.Neos:Page) {
@cache {
entryIdentifier {
paginationArgument = ${request.httpRequest.arguments['--event']['currentPage']}
entryTags {
1 = ${'NodeType_Ttree.News:Event'}
}
}
}
# Add paginationArgument to the root entryIdentifier
root {
@cache {
entryIdentifier {
paginationArgument = ${request.httpRequest.arguments['--event']['currentPage']}
}
}
}
\ No newline at end of file
prototype(TYPO3.Neos:Page).@cache.entryIdentifier.paginationArgument = ${request.httpRequest.arguments['--event']['currentPage']}
root.@cache.entryIdentifier.paginationArgument = ${request.httpRequest.arguments['--event']['currentPage']}
prototype(Ttree.News:EventCollection) < prototype(TYPO3.TypoScript:Case) {
upcomingEvents {
condition = ${displayMode == 'upcomingEvents'}
type = 'Ttree.News:EventUpcoming'
}
pastEvents {
condition = ${displayMode == 'pastEvents'}
type = 'Ttree.News:EventPast'
}
allEvents {
condition = ${displayMode == 'allEvents'}
type = 'Ttree.News:EventAll'
}
upcomingEvents {
condition = ${displayMode == 'upcomingEvents'}
type = 'Ttree.News:EventUpcoming'
}
pastEvents {
condition = ${displayMode == 'pastEvents'}
type = 'Ttree.News:EventPast'
}
allEvents {
condition = ${displayMode == 'allEvents'}
type = 'Ttree.News:EventAll'
}
default {
condition = ${true}
type = 'Ttree.News:EventUpcoming'
}
}
prototype(Ttree.News:EventUpcoming) < prototype(TYPO3.TypoScript:Value) {
eventCollection = ${q(documentNode).find('[instanceof Ttree.News:Event]').get()}
eventCount = ${q(this.eventCollection).count()}
eventCollection = ${allEventCollection}
eventCount = ${q(allEventCollection).count()}
value = ${this.eventCount > 0 ? q(this.eventCollection).filterByDate('startDate', Date.today(), '>').get() : NULL}
value.@process.sort = ${value ? q(value).sort(sortProperty, 'ASC').get() : NULL}
......@@ -25,8 +30,8 @@ prototype(Ttree.News:EventUpcoming) < prototype(TYPO3.TypoScript:Value) {
}
prototype(Ttree.News:EventPast) < prototype(TYPO3.TypoScript:Value) {
eventCollection = ${q(documentNode).find('[instanceof Ttree.News:Event]').get()}
eventCount = ${q(this.eventCollection).count()}
eventCollection = ${allEventCollection}
eventCount = ${q(allEventCollection).count()}
value = ${this.eventCount > 0 ? q(this.eventCollection).filterByDate('startDate', Date.today(), '<').get() : NULL}
value.@process.sort = ${value ? q(value).sort(sortProperty, 'DESC').get() : NULL}
......@@ -34,7 +39,7 @@ prototype(Ttree.News:EventPast) < prototype(TYPO3.TypoScript:Value) {
}
prototype(Ttree.News:EventAll) < prototype(TYPO3.TypoScript:Value) {
value = ${q(documentNode).find('[instanceof Ttree.News:Event]').get()}
value = ${allEventCollection}
value.@process.sort = ${value ? q(value).sort(sortProperty, 'ASC').get() : NULL}
value.@process.slice = ${value ? q(value).slice(0, numberOfItems).get() : NULL}
}
......@@ -2,11 +2,11 @@ prototype(Ttree.News:EventLatest) < prototype(Ttree.News:AbstractEventList) {
templatePath = 'resource://Ttree.News/Private/Templates/Event/List.html'
node = ${site}
@override.documentNode = ${site}
@context.documentNode = ${site}
numberOfItems = ${q(node).property('numberOfItems')}
@override.numberOfItems = ${this.numberOfItems}
@context.numberOfItems = ${this.numberOfItems}
displayMode = 'upcomingEvents'
@override.displayMode = ${this.displayMode}
@context.displayMode = ${this.displayMode}
attributes {
class = 'list list-default latest-event'
......@@ -18,4 +18,4 @@ prototype(Ttree.News:EventLatest) < prototype(Ttree.News:AbstractEventList) {
addLinkOnTitle = true
showMoreLink = false
}
}
\ No newline at end of file
}
......@@ -2,5 +2,5 @@ prototype(Ttree.News:EventList) < prototype(Ttree.News:AbstractEventList) {
templatePath = 'resource://Ttree.News/Private/Templates/Event/List.html'
displayMode = ${q(documentNode).property('displayMode')}
@override.displayMode = ${this.displayMode}
}
\ No newline at end of file
@context.displayMode = ${this.displayMode}
}
prototype(Ttree.News:EventListArchive) < prototype(Ttree.News:AbstractEventList) {
templatePath = 'resource://Ttree.News/Private/Templates/Event/List.html'
documentNode = ${q(documentNode).property('documentNodeTarget') ? q(documentNode).property('documentNodeTarget') : documentNode}
@override.documentNode = ${this.documentNode}
storageNode = ${q(documentNode).property('documentNodeTarget') ? q(documentNode).property('documentNodeTarget') : documentNode}
displayMode = 'pastEvents'
@override.displayMode = ${this.displayMode}
@context.displayMode = ${this.displayMode}
eventCollection = Ttree.News:EventCollection {
displayMode = ${displayMode}
}
}
\ No newline at end of file
}
......@@ -6,8 +6,8 @@ prototype(Ttree.News:EventShort) < prototype(Ttree.News:Event) {
venue = ${q(node).property('venue')}
startDate = ${q(node).property('startDate')}
endDate = ${q(node).property('endDate')}
@override.startDate = ${this.startDate}
@override.endDate = ${this.endDate}
@context.startDate = ${this.startDate}
@context.endDate = ${this.endDate}
dateFormatType = Ttree.News:DatePeriod
......@@ -15,4 +15,4 @@ prototype(Ttree.News:EventShort) < prototype(Ttree.News:Event) {
showMoreLink = true
readMoreLabel = 'Read more'
}
\ No newline at end of file
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment