I’d like to access the first TYPO3.Neos.NodeTypes:Text of some page nodes as some kind of preview in another page. I can select the pages I want to display.
teaserText isn’t a property of post as it isn’t defined in NodesTypes.yaml. So, post.properties.teaserText yields NULL.
I want to use the first TextNode in my article pages as teaser text. So I’m using find()to get the first TextNode in my Article.ts2 and store it in teaserText. The categories show every article page that is their child. So, I need access to teaserText from my Category Fluid template. But I don’t know how, if it’s no property which are accessible via properties.
Make the teaserText text a property of the ArticleNode. I would consider it good practice to display it on the document and make it inline editable aswell so editors can edit it like any other text. That often works well as a leading text between Header and main content.
Use a <ts:render path=“{ArticleNodeTextRenderer}” context=“{articleNode:articleNode}”> to render the text of every node and inside try to use a flow query like this
articleNodeTextRenderer = TYPO3.TypoScript:Value {
value = ${q(articleNode).children('main').children('[instanceof TYPO3.NeosNodeTypes:Text]').property('text')}
}
Notice that i use the children-operation instead of find because this will only search directly below the selected node. The flowQuery will find all TextNodes in the main collection but the property operation will only return the value of the property in the firstNode of the collection.
*Attention i did’nt try the code above so beware of typos