Support for Panelizer/Panels

Created on 8 November 2021, about 3 years ago
Updated 23 March 2023, over 1 year ago

Problem/Motivation

The module fails to function correctly when used with a CTools based field pane, such as with how Panelizer renders fields.

Steps to reproduce

Setup a display mode to use Panelizer and configure a image field with "WebP support" checked. When viewing a page with the display mode of the entity the image will not be output with the webp source as the module fails to detect webp support has been enabled. This is because field_formatter_settings_get_instance_display_settings() does not work with panel panes.

Proposed resolution

Patch provided to use an alternative method when the field is being generated by a CTools/Panels pane. hook_field_attach_view_alter() provides an opportunity to read the stored setting and add the 'webp_support' property to the field array where it can be picked up on in later parts of the pipeline.

Note that using hook_field_attach_view_alter() may potentially make some of the other methods of setting the property redundant but I've not tested enough using more traditional Drupal rendering pipelines to know if that is the case. Just something to consider for the future.

✨ Feature request
Status

RTBC

Version

1.0

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom magicmyth

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024