#95100Content element sorting not taking into account colPos
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.
History 2
-
JF Belsile commented 09/03/21, 13:45
-
Georg Ringer commented and changed status
NewClosed 07/28/24, 08:07hey!
thanks for creating the issue. as this is easily to solve for an integrator and the core can’t do it right anyway because not knowing which colpos values and which order (e.g. also maybe skip sections) I am closing the issue