Sorting relations #59
-
Hi, I have several tables related together with MM relations. I have noticed that - in the API results - the relations are not ordered as they are in the backend. Since the documentation is a bit lacking, I couldn't find if there was a way to order the relations. I have checked the examples for the news extension (https://github.com/sourcebroker/t3apinews/blob/master/Classes/Domain/Model/News.php), but I see no particular configuration for the Is that actually possible at all? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @fsuter, Just to be clear, Please confirm if it resolved your issue. |
Beta Was this translation helpful? Give feedback.
-
Hi Karol. Thanks for your answer. I could find that there are several places in my project (it's a complex one) where sorting information is either not well-defined or gets lost. |
Beta Was this translation helpful? Give feedback.
-
Hi @fsuter. I guess you mean TCA'a I agree that t3api should allow to apply default sorting without query parameter. Already had cases when default sorting has to be applied but for now always resolved it with query parameter inside URL (OrderFilter). But even when we introduce default sorting it will be rather done inside definition of |
Beta Was this translation helpful? Give feedback.
Hi @fsuter,
Just to be clear,
t3api
extension does not change default Extbase/TCA behaviour, so I guess that order is different than expected not only in API response but also in standard FE implementation (e.g. when you fetch records inside plugin from Repository).Thus, I think that field
foreign_sortby
might be what you are looking for: https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Inline/Properties/ForeignSortby.htmlPlease confirm if it resolved your issue.