[SOLVED] Property of all sites


I am new to Neos/Flow and have a question, that the doku couldn’t tell me. I want to combine a property (e.g title) of all pages to an array. I have a ViewHelper where I could it perform via php, but I dont know how to build the ts2 to get the property from all pages.

I thought somethink like this:

allTitles = ${q(site).getAllPages().property('title')}

Thanks for your help :slight_smile:

In Neos 3.0 this will become easy:

allTitles = Neos.Fusion:RawCollection {
  collection = ${q(site).find('[instanceof Neos.Neos:Document]').get()}
  itemName = 'item'
  itemRenderer = ${q(item).property('title')}

For Neos2.3 i suggest to create a custom FlowQuery operation. See http://neos.readthedocs.io/en/stable/ExtendingNeos/CustomFlowQueryOperations.html

Hallo martoro,

Thank you for your answer. Instead of the FlowQuery operation I used the nodeSearchService:

$this->context = $this->contextFactory->create(array('workspaceName' => 'live'));
$allNodes = $this->nodeSearchService->findByProperties('title', array('TYPO3.Neos.NodeTypes:Page'), $this->context);
foreach ($allNodes as $node){
     echo $node->getProperty('title');

Works fine. Looking forward to version 3.

1 Like

Ahh … you are already in php. I just thought about fusion. Nice that you got it working.