Issue Bug Closed

#95100Content element sorting not taking into account colPos

JF Belsile 09/03/21, 13:39 updated 07/28/24, 08:07

Description

we have a custom backend layout with multiple rows and some of them having multiple columns. We are using colPos incrementaly in our layout

<f:cObject
                                    typoscriptObjectPath="lib.dynamicContent"
                                    data="{pageUid: '{data.uid}', colPos: '0'}"
                                />

                                <div class="row multiple-columns">
                                    <div class="col-sm-6 px-sm-0">
                                        <f:cObject
                                            typoscriptObjectPath="lib.dynamicContent"
                                            data="{pageUid: '{data.uid}', colPos: '1'}"
                                        />
                                    </div>
                                    <div class="col-sm-6 px-sm-0">
                                        <f:cObject
                                            typoscriptObjectPath="lib.dynamicContent"
                                            data="{pageUid: '{data.uid}', colPos: '2'}"
                                        />
                                    </div>
                                </div>

                                <f:cObject
                                    typoscriptObjectPath="lib.dynamicContent"
                                    data="{pageUid: '{data.uid}', colPos: '3'}"
                                />

But the sorting column of our tt_content get calculated with colPos 0 as the last one. So the element in colPos 0, which higher in the page get a sorting greater than the elements in colPos further down the page.

To fix this we need to override the Typoscript config of the MenuSection element. Setting the orderBy of the Database query to colPos, sorting

dataProcessing {
                10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                10 {
                    references.fieldName = media
                }
                20 = TYPO3\CMS\Frontend\DataProcessing\DatabaseQueryProcessor
                20 {
                    table = tt_content
                    pidInList.field = uid
                    as = content
                    where = sectionIndex = 1
                    orderBy = sorting
                    dataProcessing {
                        10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                        10 {
                            references.fieldName = image
                        }
                    }
                }
            }

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.