content_defender
content_defender copied to clipboard
not providing a colPos results in configuration missmatch
It is possible to either define colPos =
without a value, or to omit this value.
In the 2nd case, the extension might not work as expected.
Considering the following template:
mod {
web_layout {
BackendLayouts {
ContentWithCustomHeader {
title = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:backendlayouts.contentWithCustomHeader
config {
backend_layout {
colCount = 12
rowCount = 3
rows {
1 {
columns {
1 {
name = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:backendlayouts.columns.header.info
colPos = 11
colspan = 6
allowed {
CType = site_info
}
}
2 {
name = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:backendlayouts.columns.header.slider
colspan = 6
}
}
}
2 {
columns {
1 {
name = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:backendlayouts.columns.content
colPos = 0
colspan = 8
disallowed {
CType = site_info
}
}
2 {
name = LLL:EXT:sitepackage/Resources/Private/Language/locallang.xlf:backendlayouts.columns.navigation
colspan = 4
}
}
}
}
}
}
}
}
}
}
Will not work as expected for colPos = 0
as row 1 column 2 already is evaluated as 0
and re used.
I would recommend to either document that a colPos
should always be defined, or add a isset($column['colPos']) &&
check to BackendLayoutConfiguration::getConfigurationByColPos()
.
I guess the issue only occurs if colPos=0
comes after an missing colPos
.
Hi @DanielSiepmann,
Would you mind to point me to the documentation, that allows the abstinence of colPos completely? There are tests integrated for an empty value to hide the column from any input, but I'm not aware that completely omitting the colpos is possible too.
Actually I encountered that using an empty colPos
, instead of omitting it, results in the same title for columns within the same row :(
So to use TYPO3 without an assigned colPos
(9.5 LTS), you actually need to not provide colPos
at all.
Using above example with colPos =
for row 2 and column 2 would result in the same title for row 2 and column 1, as both are considered "0" then by TYPO3.
Actually I am only aware of https://docs.typo3.org/m/typo3/reference-tsconfig/master/en-us/PageTsconfig/Mod.html#backendlayouts which is very basic and does not cover this case at all.
https://github.com/TYPO3/TYPO3.CMS/blob/9.5/typo3/sysext/backend/Classes/View/PageLayoutView.php#L1190 is the place where TYPO3 has its logic. TYPO3 is also checking via isset
first, then it will check for an empty string.
I would consider TYPO3 does support both ways, but has a bug in the one when colPos
is empty.
Hi @DanielSiepmann,
With the current version TYPO3 12.1 around, unused BackendLayout columns need to be configured as
2 {
name = unused
}
This is tested with the provided fixtures for pageTS-Templates and I close this issue for now. If there are any further problems, please open a new issue.