I have an Extbase Model Article and a 1:n Relation Product. In Article TCA i have an inline field configuered. In my Article Template I want to display all related Products. These are oredered by uid. How can i change the ordering of the child objects to the field sorting to be able to manually sort them. ( In the backend form the sorting is possible, only diplaying them sorted by field sorting is not possible )
thanks, Lukas
The easiest way to sort child elements in a object storage is to manipulate the TCA.
Example:
$TCA['tx_myext_domain_model_ordering'] = array(
...
'columns' => array(
'services' => array(
'exclude' => 0,
'label' => 'LLL:EXT:myext/Resources/Private/Language/locallang_db.xml:tx_myext_domain_model_ordering.services',
'config' => array(
'type' => 'inline',
'foreign_table' => 'tx_myext_domain_model_service',
'foreign_field' => 'ordering',
'foreign_sortby' => 'sorting',
'maxitems' => 9999,
'appearance' => array(
'collapseAll' => 0,
'levelLinksPosition' => 'top',
'showSynchronizationLink' => 1,
'showPossibleLocalizationRecords' => 1,
'showAllLocalizationLink' => 1
),
),
),
),
...
);
With the filed 'foreign_sortby' => 'sorting', you can easily say on which field the childs should be ordered.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With