From f266a734b819a4db60494355ef2c8f1dea28bcf8 Mon Sep 17 00:00:00 2001 From: mlloydbixal Date: Fri, 2 Aug 2024 10:57:16 -0400 Subject: [PATCH 1/2] VOTE-2380: Only allow 'image' as embedded option in WYSIWYG --- config/sync/filter.format.basic_html.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/sync/filter.format.basic_html.yml b/config/sync/filter.format.basic_html.yml index 1f23c5f34..16bb8bb6b 100644 --- a/config/sync/filter.format.basic_html.yml +++ b/config/sync/filter.format.basic_html.yml @@ -33,4 +33,5 @@ filters: default_view_mode: default allowed_view_modes: default: default - allowed_media_types: { } + allowed_media_types: + image: image From 206c679d36e7f95aacc902ae995ea163b14bbff9 Mon Sep 17 00:00:00 2001 From: Ray Estrada Date: Tue, 6 Aug 2024 10:53:33 -0700 Subject: [PATCH 2/2] Add a dedicated display mode for images embedded in the wysiwyg --- ...entity_view_display.media.image.scaled.yml | 46 +++++++++++++++++++ .../core.entity_view_mode.media.scaled.yml | 11 +++++ config/sync/filter.format.basic_html.yml | 6 ++- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 config/sync/core.entity_view_display.media.image.scaled.yml create mode 100644 config/sync/core.entity_view_mode.media.scaled.yml diff --git a/config/sync/core.entity_view_display.media.image.scaled.yml b/config/sync/core.entity_view_display.media.image.scaled.yml new file mode 100644 index 000000000..649a08e2a --- /dev/null +++ b/config/sync/core.entity_view_display.media.image.scaled.yml @@ -0,0 +1,46 @@ +uuid: 626b9a83-0f93-4953-97a8-ca30a42cf88f +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.media.scaled + - field.field.media.image.field_caption + - field.field.media.image.field_media_image + - image.style.scaled_lg + - media.type.image + module: + - svg_image + - text +id: media.image.scaled +targetEntityType: media +bundle: image +mode: scaled +content: + field_caption: + type: text_default + label: above + settings: { } + third_party_settings: { } + weight: 1 + region: content + field_media_image: + type: image + label: visually_hidden + settings: + image_link: '' + image_style: scaled_lg + image_loading: + attribute: lazy + svg_attributes: + width: null + height: null + svg_render_as_image: true + third_party_settings: { } + weight: 0 + region: content +hidden: + created: true + langcode: true + name: true + thumbnail: true + uid: true diff --git a/config/sync/core.entity_view_mode.media.scaled.yml b/config/sync/core.entity_view_mode.media.scaled.yml new file mode 100644 index 000000000..6e5504c14 --- /dev/null +++ b/config/sync/core.entity_view_mode.media.scaled.yml @@ -0,0 +1,11 @@ +uuid: 71e28add-26ea-4400-9cde-70baf155c1df +langcode: en +status: true +dependencies: + module: + - media +id: media.scaled +label: Scaled +description: '' +targetEntityType: media +cache: true diff --git a/config/sync/filter.format.basic_html.yml b/config/sync/filter.format.basic_html.yml index 16bb8bb6b..04371b104 100644 --- a/config/sync/filter.format.basic_html.yml +++ b/config/sync/filter.format.basic_html.yml @@ -2,6 +2,8 @@ uuid: 7541554d-e57b-4314-953a-24e11f9082c4 langcode: en status: true dependencies: + config: + - core.entity_view_mode.media.scaled module: - ckeditor5_embedded_content - media @@ -30,8 +32,8 @@ filters: status: true weight: 100 settings: - default_view_mode: default + default_view_mode: scaled allowed_view_modes: - default: default + scaled: scaled allowed_media_types: image: image