[Neos] ts2 query to find a node with a specific property value

Dominic Garms djgarms at gmail.com
Tue Jan 28 19:01:28 CET 2014


On 28/01/14 18:29, Christopher Hlubek wrote:
> Hi Dominic,
>
> startingPoint = ${q(site).children('blog')
>
> Should do what you wanted (maybe add .get() to get only one node instead of a FlowQuery result.
>
> .property('foo') basically just returns the property value of the first matched node. It's like in jQuery.
>
> Greetings,
>
> Christopher
>
>> Am 28.01.2014 um 18:17 schrieb Dominic Garms <djgarms at gmail.com>:
>>
>> Hello,
>>
>> I am stuck with a query over the whole document nodes finding one with a specific property. I need this for a specific startinPoint for a menu, it should be a similar feature with ID's in TYPO3 CMS. I tried following:
>>
>> startingPoint = ${q(site).children().find('[instanceof TYPO3.Neos.NodeTypes:Page]').property('_name') == 'blog'}
>>
>> Would be great if someone has an idea,
>>
>> Regards,
>> Dominic
>> _______________________________________________
>> Neos mailing list
>> Neos at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos
Hi Christoper,

${q(site).children('blog').get(0)}

That's exactly what I was looking for! Thanks

Cheers,
Dominic


More information about the Neos mailing list