[Neos] Traversing query results and use template for each element
Carsten Bleicker
carsten at bleicker.de
Sun Feb 16 17:16:07 CET 2014
currently i am fetching nodes by a flow query elaticsearch operation.
this works realy nice. but i am stuck ant the point traversing over the restults:
prototype(TYPO3.Neos:PrimaryContent).elasticSearch {
condition = ${q(request).property('arguments.search')}
type = 'BLEICKER.Bleicker:SearchResult'
}
prototype(BLEICKER.Bleicker:SearchResult) < prototype(TYPO3.TypoScript:Template){
templatePath = 'resource://BLEICKER.Bleicker/Private/Templates/TypoScriptObjects/SearchResult.html'
searchTerm = ${q(request).property('arguments.search')}
documents = ${q(ElasticSearch.query(site).nodeType('TYPO3.Neos:Document').sortDesc('publicationDate').execute())}
documentListItem = BLEICKER.Bleicker:SearchResultItem
}
prototype(BLEICKER.Bleicker:SearchResultItem) < prototype(TYPO3.TypoScript:Template) {
templatePath = 'resource://BLEICKER.Bleicker/Private/Templates/TypoScriptObjects/SearchResultItem.html'
title = ${q(node).property('title')}
description = ${q(node).property('description')}
publicationDate = ${q(node).property('publicationDate')}
author = ${q(node).property('author')}
firstFoundContent = ${q(ElasticSearch.query(node).nodeType('TYPO3.Neos:Content').execute()).get(0)}
}
documentListItem at this point having having the node of the site wich i am currenlty viewing.
how to make "node" as the current item of traversing "documents"?
kind regards
carsten
More information about the Neos
mailing list