Zum Inhalt springen

Define maximum image width per column

The instructions refer to older TYPO3 versions where the extension "css_styled_content" is still in use.

If an editor has failed to enter an image width, it can easily happen that too large an image is output and the layout may be ruined. The solution is to limit the image width for each column.

Setup:

tt_content.image.20.maxW.cObject = CASE
tt_content.image.20.maxW.cObject {
key.field = colPos
## Normal
    0 = TEXT
    0.value = 440
## Left
    1 = TEXT
    1.value = 340
## Right
    2 = TEXT
    2.value = 190
## Border
    3 = TEXT
    3.value = 220
}

Set image width for specific page(s)

The following code can be used to set the maximum image width for one or more pages only.

# Limit maximum image width only for the page with ID 1
[globalVar = TSFE:id = 1]
tt_content.image.20.maxW.cObject.0.value = 600
[global]

# Limit maximum image width for pages with IDs 1, 4 and 8
[globalVar = TSFE:id = 1|4|8]
tt_content.image.20.maxW.cObject.0.value = 400
[global]
Updated: 10.04.2025