[TYPO3-dev] <v:iterator.sort> really best option to sort foreign objects?

bugblatterbeast info at bugblatterbeast.de
Wed Jul 13 22:02:56 CEST 2016


Hi,

the $defaultOrderings from my repositories doesn't seem to have any effect, when I render foreign objects from an ObjectStorage.

    <f:for each="{object.child}" as="child">
	...output child...
    </f:for>

No matter what I do to the repository/model/controller doesn't change the sorting order of the child elements. The only way I found so far, was doing it in the view by relying on the extension "VHS: Fluid ViewHelpers" like this:

{namespace v=FluidTYPO3\Vhs\ViewHelpers}
..

    <f:for each="{object.child->v:iterator.sort(order: 'DESC', sortBy: 'crdate')}" as="child">
	...output child...
    </f:for>

Now I'm wondering if this is really the best option. I'd prefer to set a default sort that affects the SQL-statement. I think that would be more efficient and I don't like to be depending on a non-core extension.

Do you know any other solutions for this problem? How do you deal with it?

Kind regards, Nils



More information about the TYPO3-dev mailing list