Actions
Feature #102215
openViewHelper to generate srcset for responsive images
Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-10-20
Due date:
% Done:
0%
Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:
Description
After some initial HTML standards confusion, srcset/sizes/picture are well-established in the web and are used in a lot of TYPO3 projects nowadays. While there are a few 3rd party extensions out there (I built one of them), I really think that this should be part of the core along the existing ImageViewHelper.
As a first step, I would like to add a new SrcsetViewHelper, which only renders the attribute without any tag. Thus, it is very flexible and can be used:
- with custom img tags not using the ImageViewHelper
- with the various options the
<picture>
tag offers - with
<link rel="preload" as="image" imagesrcset="..." />
to preload responsive images - with the existing ImageViewHelper and
additionalAttributes
(however I think that this should be integrated in a next step)
I try to keep the ViewHelper API as simple as possible to prevent complexity similar to ImageViewHelper. I would also like to extract the core functionality to a utility class, so that it becomes available to other parts of the core as well as 3rd party extensions.
Actions