[Neos] Creating a New FlowQuery Operation

Dmitri Pisarev dimaip at gmail.com
Mon Feb 2 21:15:26 CET 2015


Frankly I don't know what it does use for sorting now.
If you need particular sorting, you could do that via custom FQ operation,
but it's not very fast for large amount of nodes.
Sorting will be much easier soon, as there'll be a native way to do that
with FlowQuery.

On Mon Feb 02 2015 at 7:05:03 PM nikos <nick at jamalade.com> wrote:

> Hi Dmitri
>
> Thanks ${q(targetNode).find('[instanceof TYPO3.Neos.NodeTypes:Headline]').first()}
> is perfect, don't know how I missed that.
>
> I am curious a little of how it determines the sort order of the
> collection returned. Seems to be using "sortingindex" which is on the
> database but I
> am not sure you can "override that" and it can lead to unexpected behavior
> eg
>
> for the following structure
>
> main
>    Heading A
>      section1
>        Heading B
>        section2
>          Heading C
>        Heading D
>    Heading E
>
> I get the following :
>      A, B, E, D, C
>
> whereas I would have expected:
>     A, B, C, D, E (depth first search)
> or
>     A, E, B, D, C (breath first search)
>
> For what I am after at the moment that doesn't matter but could be useful
> to understand.
>
> Thanks anyway and also for the examples.
>
> Nikos
>
>
>
>
>
> On 31/01/2015 14:32, Dmitri Pisarev wrote:
> > Hey Nikos!
> > Maybe this would work?
> > ${q(site).find('[instanceof TYPO3.Neos.NodeTypes:Headline']).get(0)}
> > Also there's operation .first(), but I don't quite remember if that's
> what
> > you need.
> >
> > Custom FQ operations are super easy too, see some examples here:
> > https://github.com/sfi-ru/Sfi.News/tree/master/Classes/Sfi/
> News/TypoScript/Eel/FlowQueryOperations
> >
> > On Sat, Jan 31, 2015, 2:55 PM nikos <nick at jamalade.com> wrote:
> >
> >> Hi
> >>
> >> In my Typoscript given a node I would like to be able to traverse down
> >> through the child nodes to find the first occurrence of a particle node
> type
> >> say a TYPO3.Neos.NodeTypes:Headline.
> >>
> >> I would like to be able to write something like this in my ts:
> >>
> >>      theHeadline = $(q(node).FindFirst('[instanceOf
> >> TYPO3.Neos.NodeTypes:Headline ]').property.('title')}
> >>
> >>
> >> If I had a structure like these
> >>
> >> Page
> >>       main
> >>           section
> >>                Headline
> >> Page
> >>       main
> >>           Headline
> >>
> >> Page
> >>       main
> >>           section
> >>               image
> >>           section2
> >>               Headline
> >>
> >> The query would return the Headline.
> >>
> >> I can't see a way of doing this at the moment so I figure that I need to
> >> implement a FlowQuery operation to do this. I am wondering if there is
> any
> >> help/guidance available for implementing such an operation.
> >>
> >> I would appreciate any guidance with this.
> >>
> >> Warm wishes
> >>
> >> Nikos
> >>
> >>
> >> _______________________________________________
> >> Neos mailing list
> >> Neos at lists.typo3.org
> >> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos
> >>
>
> _______________________________________________
> Neos mailing list
> Neos at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/neos
>


More information about the Neos mailing list