Responsive images support

Created on 9 January 2024, 10 months ago
Updated 21 February 2024, 9 months ago

Problem/Motivation

Add responsive image support for CDN mode. A custom formatted should be created, which behaves the same way, as the core responsive image formatter, but instead of file paths to image style files in Drupal, direct CDN links to the Kontainer image with the correct template (CDN image conversion config entity) should be used for the srcsets. The CDN templates should be mapped 1:1 to Drupal image styles (default for non-mapped image styles should be the original image CDN URL) as a dropdown in the CDN image conversion config entity. A width numeric value should also be added to the same config entity. For non-image Kontainer media types, the formatter should behave the same way as it does now.

Proposed resolution

• Add dimensions (width) as text/number input to the CDN conversion config entity
• Add a dropdown for Drupals image conversion mapping to the CDN conversion config entity (1:1)
• Drupal image styles, that are not mapped to any CDN conversion entity (Kontainer template), will just default to the original image
• Create a custom formatter, which will act as the one in core, but will fit our requirements (CDN URLs instead of Drupal file paths)
• Implement preprocess hook for the responsive image template (mimic logic form core, but fit to our requirements)
• Update module configuration schema

Feature request
Status

Fixed

Version

1.0

Component

Code

Created by

🇸🇮Slovenia slogar32

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024