Project

General

Profile

Actions

Bug #95493

closed

TS layoutKey adds double slashes to srcset

Added by Simon Würstle over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
TypoScript
Start date:
2021-10-06
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

An image output with typoscript object of type IMAGE and setting a layoutKey generates double slashes to the srcset URLs (TYPO3 11.5). This did not happen in TYPO3 11.4 and below.

foo = IMAGE
foo {
    file {
        import.data = file:current:uid
        treatIdAsReference = 1
    }
    layoutKey = srcset-default
    layout {
        srcset-default {
            element (
<img width="###WIDTH###" height="###HEIGHT###" src="###SRC###" srcset="###SOURCECOLLECTION###" sizes="(max-width: ###WIDTH###px) 100vw, ###WIDTH###px" ###PARAMS### ###ALTPARAMS### ###SELFCLOSINGTAGSLASH###>
            )
            source = ###SRC### ###WIDTH###w###SRCAPPEND###
        }
    }
    sourceCollection {
        normal {
            srcappend = ,
        }
        hdpi {
            pixelDensity = 2
            quality = 70
        }
    }
}

Output:

<img width="300" height="200" src="/foobar.jpg" srcset="//foobar.jpg 300w,//foobar2.jpg 600w" sizes="(max-width: 300px) 100vw, 300px" alt="">

Actions

Also available in: Atom PDF