[TYPO3-mvc] Sorting of child records from mm relation

Dmitry Vasiliev dmitry at typo3.ru.net
Fri Jul 26 13:45:01 CEST 2013


On 25.07.2013 18:09, Stefan Kruse wrote:
> Hi,
>
>
>
> i have a object company. There I have a mm relation to subcategory.
>
> I my Extbase extension I fetch a company and want to show all assigned
> subcategories =>  sorted by subcategory name.
>
> Is there a way to sort these child objects alphabetical without a repository
> find method?
>
>
>
> What's the best way to do? Should it be done over the model maybe?
>
>
>
> Thanks stefan
>
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
>
Hello. try adding  "foreign_sortby", to your TCA company.php
Something like

         'subcategory' => array(
             'exclude' => 0,
             'label' => 'Label',
             'config' => array(
                 'type' => 'inline',
                 'foreign_table' => 
'tx_yourextension_domain_model_subcategory',
                 'foreign_field' => 'company',
                 'foreign_sortby' => 'name',
                 'maxitems'      => 9999,
                 'appearance' => array(
                     'collapseAll' => 0,
                     'levelLinksPosition' => 'top',
                     'showSynchronizationLink' => 1,
                     'showPossibleLocalizationRecords' => 1,
                     'showAllLocalizationLink' => 1
                 ),
             ),
         ),


More information about the TYPO3-project-typo3v4mvc mailing list