Project

General

Profile

Actions

Bug #95100

open

Content element sorting not taking into account colPos

Added by JF Belsile over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2021-09-03
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.4
Tags:
Complexity:
Is Regression:
Sprint Focus:

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
                        }
                    }
                }
            }
Actions #1

Updated by JF Belsile over 2 years ago

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 = colPos, sorting
                    dataProcessing {
                        10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
                        10 {
                            references.fieldName = image
                        }
                    }
                }
            }
Actions

Also available in: Atom PDF