- πΊπΈUnited States dmundra Eugene, OR
I need to confirm but I don't believe the default image formatter works with views. The option does exist but the original image is returned with no webp srcset.
- Status changed to Needs review
almost 2 years ago 9:53pm 4 March 2023 - ππΊHungary danyg Budapest
Here is the patch that makes the Views' simple image formatter work. Since the Views uses the field_view_field() and doesn't use the hook_preprocess_field, I added an implementation of hook_field_attach_view_alter() which is invoked within field_view_field() function.
As an admin, you need to choose the Image formatter and tick the "Webp support" checkbox to make it work.
We should improve it by handling the other formatters as it is written in https://www.drupal.org/project/imagewebp/issues/3226638 β
- Status changed to RTBC
almost 2 years ago 6:23pm 9 March 2023 - πΊπΈUnited States dmundra Eugene, OR
@danyg works for me as well.
FYI for others the patch does conflict with the panels patch from https://www.drupal.org/project/imagewebp/issues/3248259 β¨ Support for Panelizer/Panels RTBC so you have to revert that one and apply this one.
- πΊπΈUnited States dmundra Eugene, OR
Looks like patch #15 also works with panels.