diff --git a/modules/hdbt_admin_tools/assets/images/paragraph--image-gallery.svg b/modules/hdbt_admin_tools/assets/images/paragraph--image-gallery.svg new file mode 100644 index 000000000..fa761ef7a --- /dev/null +++ b/modules/hdbt_admin_tools/assets/images/paragraph--image-gallery.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/modules/hdbt_admin_tools/hdbt_admin_tools.module b/modules/hdbt_admin_tools/hdbt_admin_tools.module index 2048d872b..cc836d1c7 100644 --- a/modules/hdbt_admin_tools/hdbt_admin_tools.module +++ b/modules/hdbt_admin_tools/hdbt_admin_tools.module @@ -522,6 +522,14 @@ function hdbt_admin_tools_entity_bundle_field_info_alter(&$fields, EntityTypeInt ) { $fields['field_has_hero']->addConstraint('Hero', []); } + + if ($entity_type->id() === 'paragraph' && $bundle == 'image_gallery') { + // Add constraint to check if image gallery has two gallery items. + if (array_key_exists('field_gallery_item', $fields)) { + $fields['field_gallery_item']->addConstraint('ImageGallery', []); + } + } + } /** diff --git a/modules/hdbt_admin_tools/src/Plugin/Validation/Constraint/ImageGalleryConstraint.php b/modules/hdbt_admin_tools/src/Plugin/Validation/Constraint/ImageGalleryConstraint.php new file mode 100644 index 000000000..e8f2da2ce --- /dev/null +++ b/modules/hdbt_admin_tools/src/Plugin/Validation/Constraint/ImageGalleryConstraint.php @@ -0,0 +1,27 @@ +getEntity(); + + if ($value->getName() !== 'field_gallery_item') { + return; + } + + if ( + $parent && + $parent->hasField('field_gallery_item') && + $parent->get('field_gallery_item')->count() < 2 + ) { + $this->context->addViolation($constraint->galleryItemRequired); + } + } + +} diff --git a/modules/hdbt_admin_tools/translations/fi.po b/modules/hdbt_admin_tools/translations/fi.po index 47e6babb1..7eac9e17e 100644 --- a/modules/hdbt_admin_tools/translations/fi.po +++ b/modules/hdbt_admin_tools/translations/fi.po @@ -149,3 +149,9 @@ msgstr "Tekstialue (merkkimäärälaskuri)" msgid "Textfield (character counter)" msgstr "Tekstikenttä (merkkimäärälaskuri)" + +msgid "Image gallery paragraph should have at least two items." +msgstr "Kuvagalleriassa tulisi olla vähintään kaksi kuvaa." + +msgid "Image is mandatory with the selected Hero design." +msgstr "Kuva on pakollinen valitun designin kanssa." \ No newline at end of file diff --git a/modules/hdbt_admin_tools/translations/sv.po b/modules/hdbt_admin_tools/translations/sv.po index 9e210f8e8..e8a0b1ff0 100644 --- a/modules/hdbt_admin_tools/translations/sv.po +++ b/modules/hdbt_admin_tools/translations/sv.po @@ -45,3 +45,9 @@ msgstr "Uppdatera användarlösenord" msgid "Hero paragraph is mandatory if the Hero checkbox has been selected. Either unselect the checkbox or create the hero paragraph by clicking the Add Hero button." msgstr "Hero paragraph är obligatoriskt om kryssrutan Hero har markerats. Avmarkera antingen kryssrutan eller skapa hero paragraph genom att klicka på knappen Lägg till Hero" + +msgid "Image gallery paragraph should have at least two items." +msgstr "Det bör finnas minst två bilder i bildgalleriet" + +msgid "Image is mandatory with the selected Hero design." +msgstr "Bild är obligatorisk med den valda Hero-designen." diff --git a/modules/helfi_image_styles/config/install/image.style.0.7_1086w_1630h_LQ.yml b/modules/helfi_image_styles/config/install/image.style.0.7_1086w_1630h_LQ.yml new file mode 100644 index 000000000..d83c1f7d1 --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.0.7_1086w_1630h_LQ.yml @@ -0,0 +1,24 @@ +uuid: 74ef3c22-d7ea-4cb1-8aab-01ba6b79bde5 +langcode: en +status: true +dependencies: + module: + - focal_point + - image_style_quality +name: 0.7_1086w_1630h_LQ +label: 0.7_1086w_1630h_LQ +effects: + 1c1da0f4-bb6a-4f11-88eb-8cd33a8e0da2: + uuid: 1c1da0f4-bb6a-4f11-88eb-8cd33a8e0da2 + id: focal_point_scale_and_crop + weight: 1 + data: + width: 1086 + height: 1630 + crop_type: focal_point + c319bca0-92f7-4467-a5ec-1b902ce2be1b: + uuid: c319bca0-92f7-4467-a5ec-1b902ce2be1b + id: image_style_quality + weight: 2 + data: + quality: 65 diff --git a/modules/helfi_image_styles/config/install/image.style.0.7_352w_572h.yml b/modules/helfi_image_styles/config/install/image.style.0.7_352w_572h.yml new file mode 100644 index 000000000..a0c7d7a3f --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.0.7_352w_572h.yml @@ -0,0 +1,17 @@ +uuid: f0276d08-9181-4923-9b87-49e9bf5ee5f4 +langcode: en +status: true +dependencies: + module: + - focal_point +name: 0.7_352w_572h +label: 0.7_352w_572h +effects: + 11ff7a5b-af0b-4eac-a4a3-7bc3b9ac6188: + uuid: 11ff7a5b-af0b-4eac-a4a3-7bc3b9ac6188 + id: focal_point_scale_and_crop + weight: 1 + data: + width: 352 + height: 572 + crop_type: focal_point diff --git a/modules/helfi_image_styles/config/install/image.style.0.7_414w_621h.yml b/modules/helfi_image_styles/config/install/image.style.0.7_414w_621h.yml new file mode 100644 index 000000000..465d0e4d6 --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.0.7_414w_621h.yml @@ -0,0 +1,17 @@ +uuid: 9ec716c1-6f6d-4d08-971f-a9d9230e43b7 +langcode: en +status: true +dependencies: + module: + - focal_point +name: 0.7_414w_621h +label: 0.7_414w_621h +effects: + dc8a6ee8-839c-4972-9eb8-5df5305dc75d: + uuid: dc8a6ee8-839c-4972-9eb8-5df5305dc75d + id: focal_point_scale_and_crop + weight: 1 + data: + width: 414 + height: 621 + crop_type: focal_point diff --git a/modules/helfi_image_styles/config/install/image.style.0.7_543w_815h.yml b/modules/helfi_image_styles/config/install/image.style.0.7_543w_815h.yml new file mode 100644 index 000000000..b6469c10b --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.0.7_543w_815h.yml @@ -0,0 +1,17 @@ +uuid: 6ff8a4a5-849c-4f94-8f22-1eb670793bdc +langcode: en +status: true +dependencies: + module: + - focal_point +name: 0.7_543w_815h +label: 0.7_543w_815h +effects: + 6535b34f-21c8-4005-8561-d1936245e319: + uuid: 6535b34f-21c8-4005-8561-d1936245e319 + id: focal_point_scale_and_crop + weight: 1 + data: + width: 543 + height: 815 + crop_type: focal_point diff --git a/modules/helfi_image_styles/config/install/image.style.0.7_704w_1144h_LQ.yml b/modules/helfi_image_styles/config/install/image.style.0.7_704w_1144h_LQ.yml new file mode 100644 index 000000000..dcf167de6 --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.0.7_704w_1144h_LQ.yml @@ -0,0 +1,24 @@ +uuid: 19aa2c22-c3e9-47cd-b767-9fca520ae4ba +langcode: en +status: true +dependencies: + module: + - focal_point + - image_style_quality +name: 0.7_704w_1144h_LQ +label: 0.7_704w_1144h_LQ +effects: + 289822b3-1d38-43a4-a18e-0344b4ef9161: + uuid: 289822b3-1d38-43a4-a18e-0344b4ef9161 + id: focal_point_scale_and_crop + weight: 1 + data: + width: 704 + height: 1144 + crop_type: focal_point + c5118eb7-9ad5-4756-9515-d6358c38bd75: + uuid: c5118eb7-9ad5-4756-9515-d6358c38bd75 + id: image_style_quality + weight: 2 + data: + quality: 65 diff --git a/modules/helfi_image_styles/config/install/image.style.0.7_828w_1242h_LQ.yml b/modules/helfi_image_styles/config/install/image.style.0.7_828w_1242h_LQ.yml new file mode 100644 index 000000000..1ead543e9 --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.0.7_828w_1242h_LQ.yml @@ -0,0 +1,24 @@ +uuid: 5ebc2957-c7ca-4606-ba96-49486e6630e4 +langcode: en +status: true +dependencies: + module: + - focal_point + - image_style_quality +name: 0.7_828w_1242h_LQ +label: 0.7_828w_1242h_LQ +effects: + fb181588-37f9-4269-ae4e-7c93d76ffebe: + uuid: fb181588-37f9-4269-ae4e-7c93d76ffebe + id: focal_point_scale_and_crop + weight: 1 + data: + width: 828 + height: 1242 + crop_type: focal_point + a3284e2a-d636-4454-b7b6-3958d1db2b35: + uuid: a3284e2a-d636-4454-b7b6-3958d1db2b35 + id: image_style_quality + weight: 2 + data: + quality: 65 diff --git a/modules/helfi_image_styles/config/install/image.style.1_1086w_1086h_LQ.yml b/modules/helfi_image_styles/config/install/image.style.1_1086w_1086h_LQ.yml new file mode 100644 index 000000000..19611f340 --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.1_1086w_1086h_LQ.yml @@ -0,0 +1,24 @@ +uuid: 9f76056d-d05c-40e9-9455-9caf237c2229 +langcode: en +status: true +dependencies: + module: + - focal_point + - image_style_quality +name: 1_1086w_1086h_LQ +label: 1_1086w_1086h_LQ +effects: + 3fe5b5a5-6dcd-4410-865d-22d39e20ae22: + uuid: 3fe5b5a5-6dcd-4410-865d-22d39e20ae22 + id: focal_point_scale_and_crop + weight: 1 + data: + width: 1086 + height: 1086 + crop_type: focal_point + 348c0fc5-7317-49a8-9a52-934e77165825: + uuid: 348c0fc5-7317-49a8-9a52-934e77165825 + id: image_style_quality + weight: 2 + data: + quality: 65 diff --git a/modules/helfi_image_styles/config/install/image.style.1_414w_414h.yml b/modules/helfi_image_styles/config/install/image.style.1_414w_414h.yml new file mode 100644 index 000000000..9bec6580b --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.1_414w_414h.yml @@ -0,0 +1,17 @@ +uuid: 0f96fcb7-856c-4d80-9a22-b1e88f44ca2b +langcode: en +status: true +dependencies: + module: + - focal_point +name: 1_414w_414h +label: 1_414w_414h +effects: + 9ef8198f-6739-4a26-b0d7-157e42648cc4: + uuid: 9ef8198f-6739-4a26-b0d7-157e42648cc4 + id: focal_point_scale_and_crop + weight: 1 + data: + width: 414 + height: 414 + crop_type: focal_point diff --git a/modules/helfi_image_styles/config/install/image.style.1_543w_543h.yml b/modules/helfi_image_styles/config/install/image.style.1_543w_543h.yml new file mode 100644 index 000000000..0ca0286db --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.1_543w_543h.yml @@ -0,0 +1,17 @@ +uuid: ca8cb2c4-7e3c-4a4a-ae75-9520f628f369 +langcode: en +status: true +dependencies: + module: + - focal_point +name: 1_543w_543h +label: 1_543w_543h +effects: + ed62a58f-6f7b-47ff-b8c9-3574fb9abeba: + uuid: ed62a58f-6f7b-47ff-b8c9-3574fb9abeba + id: focal_point_scale_and_crop + weight: 1 + data: + width: 543 + height: 543 + crop_type: focal_point diff --git a/modules/helfi_image_styles/config/install/image.style.1_828w_828h_LQ.yml b/modules/helfi_image_styles/config/install/image.style.1_828w_828h_LQ.yml new file mode 100644 index 000000000..b5b3eed9c --- /dev/null +++ b/modules/helfi_image_styles/config/install/image.style.1_828w_828h_LQ.yml @@ -0,0 +1,24 @@ +uuid: d0a56f46-9d91-47a8-9269-57fda40b75ed +langcode: en +status: true +dependencies: + module: + - focal_point + - image_style_quality +name: 1_828w_828h_LQ +label: 1_828w_828h_LQ +effects: + c4554106-234a-4d04-a6cf-c7ae4f8886dd: + uuid: c4554106-234a-4d04-a6cf-c7ae4f8886dd + id: focal_point_scale_and_crop + weight: 1 + data: + width: 828 + height: 828 + crop_type: focal_point + ee011418-cb33-48a5-af34-10bfac5b3e64: + uuid: ee011418-cb33-48a5-af34-10bfac5b3e64 + id: image_style_quality + weight: 2 + data: + quality: 65 diff --git a/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_1_1.yml b/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_1_1.yml new file mode 100644 index 000000000..beed83c84 --- /dev/null +++ b/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_1_1.yml @@ -0,0 +1,36 @@ +uuid: c0fef26d-9cc5-4756-b247-5a9c3f7b4550 +langcode: en +status: true +dependencies: + config: + - image.style.1_1086w_1086h_LQ + - image.style.1_414w_414h + - image.style.1_543w_543h + - image.style.1_828w_828h_LQ + module: + - helfi_image_styles +id: image_gallery_1_1 +label: 'Image gallery 1:1' +image_style_mappings: + - + image_mapping_type: image_style + image_mapping: 1_414w_414h + breakpoint_id: helfi_image_styles.m + multiplier: 1x + - + image_mapping_type: image_style + image_mapping: 1_828w_828h_LQ + breakpoint_id: helfi_image_styles.m + multiplier: 2x + - + image_mapping_type: image_style + image_mapping: 1_543w_543h + breakpoint_id: helfi_image_styles.xs + multiplier: 1x + - + image_mapping_type: image_style + image_mapping: 1_1086w_1086h_LQ + breakpoint_id: helfi_image_styles.xs + multiplier: 2x +breakpoint_group: helfi_image_styles +fallback_image_style: 1_414w_414h diff --git a/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_2_3.yml b/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_2_3.yml new file mode 100644 index 000000000..47fde7026 --- /dev/null +++ b/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_2_3.yml @@ -0,0 +1,48 @@ +uuid: 4da06bdc-4ddf-479d-bd7a-e7ccbcf93a7e +langcode: en +status: true +dependencies: + config: + - image.style.0.7_1086w_1630h_LQ + - image.style.0.7_352w_572h + - image.style.0.7_414w_621h + - image.style.0.7_543w_815h + - image.style.0.7_704w_1144h_LQ + - image.style.0.7_828w_1242h_LQ + module: + - helfi_image_styles +id: image_gallery_2_3 +label: 'Image gallery 2:3' +image_style_mappings: + - + image_mapping_type: image_style + image_mapping: 0.7_414w_621h + breakpoint_id: helfi_image_styles.m + multiplier: 1x + - + image_mapping_type: image_style + image_mapping: 0.7_828w_1242h_LQ + breakpoint_id: helfi_image_styles.m + multiplier: 2x + - + image_mapping_type: image_style + image_mapping: 0.7_352w_572h + breakpoint_id: helfi_image_styles.s + multiplier: 1x + - + image_mapping_type: image_style + image_mapping: 0.7_704w_1144h_LQ + breakpoint_id: helfi_image_styles.s + multiplier: 2x + - + image_mapping_type: image_style + image_mapping: 0.7_543w_815h + breakpoint_id: helfi_image_styles.xs + multiplier: 1x + - + image_mapping_type: image_style + image_mapping: 0.7_1086w_1630h_LQ + breakpoint_id: helfi_image_styles.xs + multiplier: 2x +breakpoint_group: helfi_image_styles +fallback_image_style: 0.7_414w_621h diff --git a/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_3_2.yml b/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_3_2.yml new file mode 100644 index 000000000..c95859aad --- /dev/null +++ b/modules/helfi_image_styles/config/install/responsive_image.styles.image_gallery_3_2.yml @@ -0,0 +1,48 @@ +uuid: 0011a33c-b46a-4354-af09-3ea3e656a790 +langcode: en +status: true +dependencies: + config: + - image.style.1.5_1120w_746h_LQ + - image.style.1.5_378w_252h + - image.style.1.5_452w_301h + - image.style.1.5_560w_373h + - image.style.1.5_756w_504h_LQ + - image.style.1.5_904w_602h_LQ + module: + - helfi_image_styles +id: image_gallery_3_2 +label: 'Image gallery 3:2' +image_style_mappings: + - + image_mapping_type: image_style + image_mapping: 1.5_452w_301h + breakpoint_id: helfi_image_styles.m + multiplier: 1x + - + image_mapping_type: image_style + image_mapping: 1.5_904w_602h_LQ + breakpoint_id: helfi_image_styles.m + multiplier: 2x + - + image_mapping_type: image_style + image_mapping: 1.5_378w_252h + breakpoint_id: helfi_image_styles.s + multiplier: 1x + - + image_mapping_type: image_style + image_mapping: 1.5_756w_504h_LQ + breakpoint_id: helfi_image_styles.s + multiplier: 2x + - + image_mapping_type: image_style + image_mapping: 1.5_560w_373h + breakpoint_id: helfi_image_styles.xs + multiplier: 1x + - + image_mapping_type: image_style + image_mapping: 1.5_1120w_746h_LQ + breakpoint_id: helfi_image_styles.xs + multiplier: 2x +breakpoint_group: helfi_image_styles +fallback_image_style: 1.5_452w_301h diff --git a/modules/helfi_image_styles/helfi_image_styles.install b/modules/helfi_image_styles/helfi_image_styles.install index 5246af439..9d48fa73e 100644 --- a/modules/helfi_image_styles/helfi_image_styles.install +++ b/modules/helfi_image_styles/helfi_image_styles.install @@ -16,9 +16,9 @@ function helfi_image_styles_update_9002(): void { } /** - * UHF-9508 Change unit contact card responsive image styles to match new look. + * UHF-10239 Adds new image styles used by image gallery. */ -function helfi_image_styles_update_9003(): void { +function helfi_image_styles_update_9004(): void { \Drupal::service('helfi_platform_config.config_update_helper') ->update('helfi_image_styles'); } diff --git a/modules/helfi_media/config/install/core.entity_view_display.media.image.image_gallery.yml b/modules/helfi_media/config/install/core.entity_view_display.media.image.image_gallery.yml new file mode 100644 index 000000000..198aa7b75 --- /dev/null +++ b/modules/helfi_media/config/install/core.entity_view_display.media.image.image_gallery.yml @@ -0,0 +1,36 @@ +uuid: 276c125d-e2db-44ce-9576-21c45385e0dc +langcode: en +status: true +dependencies: + config: + - core.entity_view_mode.media.image_gallery + - field.field.media.image.field_media_image + - field.field.media.image.field_photographer + - media.type.image + - responsive_image.styles.image_gallery_1_1 + module: + - responsive_image +id: media.image.image_gallery +targetEntityType: media +bundle: image +mode: image_gallery +content: + field_media_image: + type: responsive_image + label: hidden + settings: + responsive_image_style: image_gallery_1_1 + image_link: '' + image_loading: + attribute: eager + third_party_settings: { } + weight: 0 + region: content +hidden: + created: true + field_photographer: true + langcode: true + name: true + search_api_excerpt: true + thumbnail: true + uid: true diff --git a/modules/helfi_media/config/install/core.entity_view_mode.media.image_gallery.yml b/modules/helfi_media/config/install/core.entity_view_mode.media.image_gallery.yml new file mode 100644 index 000000000..e5f4361dc --- /dev/null +++ b/modules/helfi_media/config/install/core.entity_view_mode.media.image_gallery.yml @@ -0,0 +1,11 @@ +uuid: c52c9e44-0d46-417c-a8d9-372120b2c68a +langcode: en +status: true +dependencies: + module: + - media +id: media.image_gallery +label: 'Image gallery' +description: '' +targetEntityType: media +cache: true diff --git a/modules/helfi_media/helfi_media.install b/modules/helfi_media/helfi_media.install index 5ba4bda47..04ef15a18 100644 --- a/modules/helfi_media/helfi_media.install +++ b/modules/helfi_media/helfi_media.install @@ -118,9 +118,9 @@ function helfi_media_update_9013(): void { } /** - * UHF-10191: Add new view mode for Image media type. + * UHF-10239: Add new view mode for Image media type. */ -function helfi_media_update_9015(): void { +function helfi_media_update_9016(): void { // Re-import 'helfi_media' configuration. \Drupal::service('helfi_platform_config.config_update_helper') ->update('helfi_media'); diff --git a/modules/helfi_node_landing_page/helfi_node_landing_page.module b/modules/helfi_node_landing_page/helfi_node_landing_page.module index b72719bef..94240b595 100644 --- a/modules/helfi_node_landing_page/helfi_node_landing_page.module +++ b/modules/helfi_node_landing_page/helfi_node_landing_page.module @@ -32,6 +32,7 @@ function helfi_node_landing_page_helfi_paragraph_types() : array { 'target_group_links' => 12, 'event_list' => 13, 'news_list' => 14, + 'image_gallery' => 15, ], ]; diff --git a/modules/helfi_node_page/helfi_node_page.module b/modules/helfi_node_page/helfi_node_page.module index b409f31c7..94b2d51aa 100644 --- a/modules/helfi_node_page/helfi_node_page.module +++ b/modules/helfi_node_page/helfi_node_page.module @@ -33,6 +33,7 @@ function helfi_node_page_helfi_paragraph_types() : array { 'event_list' => 13, 'contact_card_listing' => 14, 'news_list' => 15, + 'image_gallery' => 16, ], 'field_lower_content' => [ 'list_of_links' => 0, @@ -50,6 +51,7 @@ function helfi_node_page_helfi_paragraph_types() : array { 'event_list' => 13, 'contact_card_listing' => 14, 'news_list' => 15, + 'image_gallery' => 16, ], 'field_sidebar_content' => [ 'from_library' => 0, diff --git a/modules/helfi_paragraphs_image_gallery/config/install/core.entity_form_display.paragraph.image_gallery.default.yml b/modules/helfi_paragraphs_image_gallery/config/install/core.entity_form_display.paragraph.image_gallery.default.yml new file mode 100644 index 000000000..db4876ef5 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/core.entity_form_display.paragraph.image_gallery.default.yml @@ -0,0 +1,63 @@ +uuid: 6f54e74d-5553-4ba9-beb0-af843b204fed +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.image_gallery.field_gallery_item + - field.field.paragraph.image_gallery.field_image_gallery_description + - field.field.paragraph.image_gallery.field_image_gallery_ratio + - field.field.paragraph.image_gallery.field_image_gallery_title + - paragraphs.paragraphs_type.image_gallery + module: + - paragraphs + - text +id: paragraph.image_gallery.default +targetEntityType: paragraph +bundle: image_gallery +mode: default +content: + field_gallery_item: + type: paragraphs + weight: 3 + region: content + settings: + title: Paragraph + title_plural: Paragraphs + edit_mode: closed + closed_mode: summary + autocollapse: none + closed_mode_threshold: 0 + add_mode: dropdown + form_display_mode: default + default_paragraph_type: image_gallery_item + features: + add_above: '0' + collapse_edit_all: collapse_edit_all + convert: '0' + duplicate: duplicate + third_party_settings: { } + field_image_gallery_description: + type: text_textarea + weight: 1 + region: content + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + field_image_gallery_ratio: + type: options_select + weight: 2 + region: content + settings: { } + third_party_settings: { } + field_image_gallery_title: + type: string_textfield + weight: 0 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } +hidden: + created: true + status: true diff --git a/modules/helfi_paragraphs_image_gallery/config/install/core.entity_form_display.paragraph.image_gallery_item.default.yml b/modules/helfi_paragraphs_image_gallery/config/install/core.entity_form_display.paragraph.image_gallery_item.default.yml new file mode 100644 index 000000000..6e5ec40e2 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/core.entity_form_display.paragraph.image_gallery_item.default.yml @@ -0,0 +1,36 @@ +uuid: ac59cef5-11ea-4ffa-8550-29adbac16965 +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.image_gallery_item.field_gallery_image + - field.field.paragraph.image_gallery_item.field_gallery_image_description + - paragraphs.paragraphs_type.image_gallery_item + module: + - hdbt_admin_tools + - media_library +id: paragraph.image_gallery_item.default +targetEntityType: paragraph +bundle: image_gallery_item +mode: default +content: + field_gallery_image: + type: media_library_widget + weight: 0 + region: content + settings: + media_types: { } + third_party_settings: { } + field_gallery_image_description: + type: textfield_character_counter + weight: 2 + region: content + settings: + counter_step: 0 + counter_total: 160 + size: 160 + placeholder: '' + third_party_settings: { } +hidden: + created: true + status: true diff --git a/modules/helfi_paragraphs_image_gallery/config/install/core.entity_view_display.paragraph.image_gallery.default.yml b/modules/helfi_paragraphs_image_gallery/config/install/core.entity_view_display.paragraph.image_gallery.default.yml new file mode 100644 index 000000000..72c6a1a81 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/core.entity_view_display.paragraph.image_gallery.default.yml @@ -0,0 +1,52 @@ +uuid: 4634b6de-c88e-4454-97b2-5333a9f68c5d +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.image_gallery.field_gallery_item + - field.field.paragraph.image_gallery.field_image_gallery_description + - field.field.paragraph.image_gallery.field_image_gallery_ratio + - field.field.paragraph.image_gallery.field_image_gallery_title + - paragraphs.paragraphs_type.image_gallery + module: + - entity_reference_revisions + - options + - text +id: paragraph.image_gallery.default +targetEntityType: paragraph +bundle: image_gallery +mode: default +content: + field_gallery_item: + type: entity_reference_revisions_entity_view + label: hidden + settings: + view_mode: default + link: '' + third_party_settings: { } + weight: 0 + region: content + field_image_gallery_description: + type: text_default + label: hidden + settings: { } + third_party_settings: { } + weight: 2 + region: content + field_image_gallery_ratio: + type: list_default + label: hidden + settings: { } + third_party_settings: { } + weight: 3 + region: content + field_image_gallery_title: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 1 + region: content +hidden: + search_api_excerpt: true diff --git a/modules/helfi_paragraphs_image_gallery/config/install/core.entity_view_display.paragraph.image_gallery_item.default.yml b/modules/helfi_paragraphs_image_gallery/config/install/core.entity_view_display.paragraph.image_gallery_item.default.yml new file mode 100644 index 000000000..059786a07 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/core.entity_view_display.paragraph.image_gallery_item.default.yml @@ -0,0 +1,32 @@ +uuid: fefcfc5a-2130-4993-868c-d7a87b3bc78f +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.image_gallery_item.field_gallery_image + - field.field.paragraph.image_gallery_item.field_gallery_image_description + - paragraphs.paragraphs_type.image_gallery_item +id: paragraph.image_gallery_item.default +targetEntityType: paragraph +bundle: image_gallery_item +mode: default +content: + field_gallery_image: + type: entity_reference_entity_view + label: hidden + settings: + view_mode: image + link: false + third_party_settings: { } + weight: 0 + region: content + field_gallery_image_description: + type: string + label: hidden + settings: + link_to_entity: false + third_party_settings: { } + weight: 2 + region: content +hidden: + search_api_excerpt: true diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_gallery_item.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_gallery_item.yml new file mode 100644 index 000000000..eba7ae5fd --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_gallery_item.yml @@ -0,0 +1,133 @@ +uuid: a36e5aa7-f3be-463e-9e9c-dff68d078701 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_gallery_item + - paragraphs.paragraphs_type.image_gallery + - paragraphs.paragraphs_type.image_gallery_item + module: + - entity_reference_revisions +id: paragraph.image_gallery.field_gallery_item +field_name: field_gallery_item +entity_type: paragraph +bundle: image_gallery +label: 'Gallery item' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:paragraph' + handler_settings: + target_bundles: + image_gallery_item: image_gallery_item + negate: 0 + target_bundles_drag_drop: + accordion: + weight: 36 + enabled: false + accordion_item: + weight: 37 + enabled: false + banner: + weight: 38 + enabled: false + chart: + weight: 39 + enabled: false + columns: + weight: 40 + enabled: false + contact_card: + weight: 41 + enabled: false + contact_card_listing: + weight: 42 + enabled: false + content_cards: + weight: 43 + enabled: false + curated_event_list: + weight: 44 + enabled: false + current: + weight: 45 + enabled: false + event_list: + weight: 46 + enabled: false + from_library: + weight: 47 + enabled: false + front_page_latest_news: + weight: 48 + enabled: false + front_page_top_news: + weight: 49 + enabled: false + hearings: + weight: 50 + enabled: false + hero: + weight: 51 + enabled: false + image: + weight: 52 + enabled: false + image_gallery: + weight: 53 + enabled: false + image_gallery_item: + weight: 54 + enabled: true + liftup_with_image: + weight: 55 + enabled: false + list_of_links: + weight: 56 + enabled: false + list_of_links_item: + weight: 57 + enabled: false + map: + weight: 58 + enabled: false + news_archive: + weight: 59 + enabled: false + news_update: + weight: 60 + enabled: false + phasing: + weight: 61 + enabled: false + phasing_item: + weight: 62 + enabled: false + popular_service_item: + weight: 64 + enabled: false + popular_services: + weight: 63 + enabled: false + remote_video: + weight: 65 + enabled: false + sidebar_text: + weight: 66 + enabled: false + social_media_link: + weight: 67 + enabled: false + target_group_link_item: + weight: 69 + enabled: false + target_group_links: + weight: 68 + enabled: false + text: + weight: 70 + enabled: false +field_type: entity_reference_revisions diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_description.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_description.yml new file mode 100644 index 000000000..db4a70349 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_description.yml @@ -0,0 +1,27 @@ +uuid: 144defda-3730-4888-97f9-13cb97a8e107 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_image_gallery_description + - paragraphs.paragraphs_type.image_gallery + module: + - allowed_formats + - text +third_party_settings: + allowed_formats: + allowed_formats: + - minimal +id: paragraph.image_gallery.field_image_gallery_description +field_name: field_image_gallery_description +entity_type: paragraph +bundle: image_gallery +label: Description +description: '' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: + allowed_formats: { } +field_type: text_long diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml new file mode 100644 index 000000000..6e3d7e6af --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml @@ -0,0 +1,23 @@ +uuid: b6356bca-1c21-4b1c-b2fe-bb8cd494f7fa +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_image_gallery_ratio + - paragraphs.paragraphs_type.image_gallery + module: + - options +id: paragraph.image_gallery.field_image_gallery_ratio +field_name: field_image_gallery_ratio +entity_type: paragraph +bundle: image_gallery +label: 'Image ratio' +description: 'Select the ratio of the images shown in the image gallery. All images will have the same ratio. By default 1:1 is selected.' +required: true +translatable: false +default_value: + - + value: ratio_1_1 +default_value_callback: '' +settings: { } +field_type: list_string diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_title.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_title.yml new file mode 100644 index 000000000..915125a50 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery.field_image_gallery_title.yml @@ -0,0 +1,19 @@ +uuid: 0055eb45-30d2-4f76-9219-e99ceabfce11 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_image_gallery_title + - paragraphs.paragraphs_type.image_gallery +id: paragraph.image_gallery.field_image_gallery_title +field_name: field_image_gallery_title +entity_type: paragraph +bundle: image_gallery +label: Title +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery_item.field_gallery_image.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery_item.field_gallery_image.yml new file mode 100644 index 000000000..a31ff447e --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery_item.field_gallery_image.yml @@ -0,0 +1,29 @@ +uuid: e450ff8a-051e-4e08-82d3-2a345e4edd63 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_gallery_image + - media.type.image + - paragraphs.paragraphs_type.image_gallery_item +id: paragraph.image_gallery_item.field_gallery_image +field_name: field_gallery_image +entity_type: paragraph +bundle: image_gallery_item +label: Image +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:media' + handler_settings: + target_bundles: + image: image + sort: + field: _none + direction: ASC + auto_create: false + auto_create_bundle: '' +field_type: entity_reference diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml new file mode 100644 index 000000000..cb1997629 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml @@ -0,0 +1,19 @@ +uuid: fe068813-e7e0-4001-8e8e-83b842c1cff6 +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_gallery_image_description + - paragraphs.paragraphs_type.image_gallery_item +id: paragraph.image_gallery_item.field_gallery_image_description +field_name: field_gallery_image_description +entity_type: paragraph +bundle: image_gallery_item +label: Description +description: 'The description of the selected image. Maximum length is 160 characters.' +required: false +translatable: false +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_image.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_image.yml new file mode 100644 index 000000000..f9560e1bb --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_image.yml @@ -0,0 +1,20 @@ +uuid: f03c616d-5f1c-4dab-8856-9049da50b3cd +langcode: en +status: true +dependencies: + module: + - media + - paragraphs +id: paragraph.field_gallery_image +field_name: field_gallery_image +entity_type: paragraph +type: entity_reference +settings: + target_type: media +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_image_description.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_image_description.yml new file mode 100644 index 000000000..94cc27e41 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_image_description.yml @@ -0,0 +1,21 @@ +uuid: b66fcec0-114b-4456-b4e4-06d13b99c7cd +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.field_gallery_image_description +field_name: field_gallery_image_description +entity_type: paragraph +type: string +settings: + max_length: 160 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_item.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_item.yml new file mode 100644 index 000000000..7001675e3 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_gallery_item.yml @@ -0,0 +1,20 @@ +uuid: aac3231f-dc54-451f-b01c-600cae4b9c2d +langcode: en +status: true +dependencies: + module: + - entity_reference_revisions + - paragraphs +id: paragraph.field_gallery_item +field_name: field_gallery_item +entity_type: paragraph +type: entity_reference_revisions +settings: + target_type: paragraph +module: entity_reference_revisions +locked: false +cardinality: 12 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_description.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_description.yml new file mode 100644 index 000000000..35ba0cbd8 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_description.yml @@ -0,0 +1,19 @@ +uuid: a70d71ee-d8c5-4718-bf09-ebff157a8085 +langcode: en +status: true +dependencies: + module: + - paragraphs + - text +id: paragraph.field_image_gallery_description +field_name: field_image_gallery_description +entity_type: paragraph +type: text_long +settings: { } +module: text +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_ratio.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_ratio.yml new file mode 100644 index 000000000..d80a31b1a --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_ratio.yml @@ -0,0 +1,21 @@ +uuid: b0297b85-5bc6-45cf-83d7-a131f5cbbf6a +langcode: en +status: true +dependencies: + module: + - options + - paragraphs +id: paragraph.field_image_gallery_ratio +field_name: field_image_gallery_ratio +entity_type: paragraph +type: list_string +settings: + allowed_values: { } + allowed_values_function: helfi_paragraphs_image_gallery_allowed_values +module: options +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_title.yml b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_title.yml new file mode 100644 index 000000000..e35be358e --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/field.storage.paragraph.field_image_gallery_title.yml @@ -0,0 +1,21 @@ +uuid: b638715b-814d-4f07-9eb5-4d6a5d63c2b9 +langcode: en +status: true +dependencies: + module: + - paragraphs +id: paragraph.field_image_gallery_title +field_name: field_image_gallery_title +entity_type: paragraph +type: string +settings: + max_length: 255 + case_sensitive: false + is_ascii: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/modules/helfi_paragraphs_image_gallery/config/install/paragraphs.paragraphs_type.image_gallery.yml b/modules/helfi_paragraphs_image_gallery/config/install/paragraphs.paragraphs_type.image_gallery.yml new file mode 100644 index 000000000..1a5efe8d6 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/paragraphs.paragraphs_type.image_gallery.yml @@ -0,0 +1,10 @@ +uuid: ce98a627-023c-4a79-a9e6-626fa4b46741 +langcode: en +status: true +dependencies: { } +id: image_gallery +label: 'Image gallery' +icon_uuid: null +icon_default: null +description: 'An image gallery where you can add 2-12 images with or without descriptions. The image gallery should have a minimum of 2 images.' +behavior_plugins: { } diff --git a/modules/helfi_paragraphs_image_gallery/config/install/paragraphs.paragraphs_type.image_gallery_item.yml b/modules/helfi_paragraphs_image_gallery/config/install/paragraphs.paragraphs_type.image_gallery_item.yml new file mode 100644 index 000000000..6eb5a945c --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/install/paragraphs.paragraphs_type.image_gallery_item.yml @@ -0,0 +1,10 @@ +uuid: 22fa68b8-b6cd-4bd9-9a87-a6ea36f37d7b +langcode: en +status: true +dependencies: { } +id: image_gallery_item +label: 'Image gallery item' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/core.entity_form_display.paragraph.image_gallery.default.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/core.entity_form_display.paragraph.image_gallery.default.yml new file mode 100644 index 000000000..2037930d5 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/core.entity_form_display.paragraph.image_gallery.default.yml @@ -0,0 +1,5 @@ +content: + field_gallery_item: + settings: + title: Lohko + title_plural: Lohkot diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_gallery_item.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_gallery_item.yml new file mode 100644 index 000000000..e3c76cd9c --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_gallery_item.yml @@ -0,0 +1,2 @@ +label: 'Gallerian kohta' +description: 'Voit lisätä 2-12 kohtaa kuvagalleriaan.' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_description.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_description.yml new file mode 100644 index 000000000..ed08ca71a --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_description.yml @@ -0,0 +1 @@ +label: Kuvaus diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml new file mode 100644 index 000000000..561c19d58 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml @@ -0,0 +1,2 @@ +label: Kuvasuhde +description: 'Valitse näytettävien kuvien kuvasuhde. Kaikille kuville tulee sama suhde.' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_title.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_title.yml new file mode 100644 index 000000000..f02d75162 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery.field_image_gallery_title.yml @@ -0,0 +1 @@ +label: Otsikko diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image.yml new file mode 100644 index 000000000..22ed4bd44 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image.yml @@ -0,0 +1 @@ +label: Kuva diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml new file mode 100644 index 000000000..ed08ca71a --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml @@ -0,0 +1 @@ +label: Kuvaus diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image_photographer.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image_photographer.yml new file mode 100644 index 000000000..ec61dc712 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/field.field.paragraph.image_gallery_item.field_gallery_image_photographer.yml @@ -0,0 +1,2 @@ +label: Valokuvaaja +description: 'Kuvan valokuvaaja' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/paragraphs.paragraphs_type.image_gallery.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/paragraphs.paragraphs_type.image_gallery.yml new file mode 100644 index 000000000..b356f57f8 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/paragraphs.paragraphs_type.image_gallery.yml @@ -0,0 +1,2 @@ +label: Kuvagalleria +description: 'Kuvagalleria johon voi lisätä 2-12 kuvaa kuvauksella tai ilman. Kuvagalleriassa tulee olla minimissään 2 kuvaa.' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/paragraphs.paragraphs_type.image_gallery_item.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/paragraphs.paragraphs_type.image_gallery_item.yml new file mode 100644 index 000000000..dc20e6766 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/fi/paragraphs.paragraphs_type.image_gallery_item.yml @@ -0,0 +1 @@ +label: 'Kuvagallerian kohta' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/core.entity_form_display.paragraph.image_gallery.default.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/core.entity_form_display.paragraph.image_gallery.default.yml new file mode 100644 index 000000000..10eaa40c5 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/core.entity_form_display.paragraph.image_gallery.default.yml @@ -0,0 +1,5 @@ +content: + field_gallery_item: + settings: + title: Paragraf + title_plural: Paragrafer diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_gallery_item.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_gallery_item.yml new file mode 100644 index 000000000..4f931489c --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_gallery_item.yml @@ -0,0 +1,2 @@ +label: 'Galleri objekt' +description: 'Du kan lägga till 2-12 galleriobjekt.' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_description.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_description.yml new file mode 100644 index 000000000..45893182c --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_description.yml @@ -0,0 +1 @@ +label: Beskrivning diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml new file mode 100644 index 000000000..c7fb93b0f --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_ratio.yml @@ -0,0 +1,2 @@ +label: Bildförhållande +description: 'Välj bildförhållandet mellan bilderna som visas i fotogalleriet. Alla bilder kommer att ha samma förhållande. Som standard är 1:1 valt.' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_title.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_title.yml new file mode 100644 index 000000000..2711e04da --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery.field_image_gallery_title.yml @@ -0,0 +1 @@ +label: Titel diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image.yml new file mode 100644 index 000000000..b7c0a4502 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image.yml @@ -0,0 +1 @@ +label: Bild diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml new file mode 100644 index 000000000..45893182c --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image_description.yml @@ -0,0 +1 @@ +label: Beskrivning diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image_photographer.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image_photographer.yml new file mode 100644 index 000000000..a80433880 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/field.field.paragraph.image_gallery_item.field_gallery_image_photographer.yml @@ -0,0 +1,2 @@ +label: Fotograf +description: 'Fotografen till bilden' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/paragraphs.paragraphs_type.image_gallery.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/paragraphs.paragraphs_type.image_gallery.yml new file mode 100644 index 000000000..9ca88d6c6 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/paragraphs.paragraphs_type.image_gallery.yml @@ -0,0 +1,2 @@ +label: Fotogalleri +description: 'Ett fotogalleri där du kan lägga till 2-12 bilder med eller utan beskrivningar. Fotogalleriet bör ha minst 2 bilder.' diff --git a/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/paragraphs.paragraphs_type.image_gallery_item.yml b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/paragraphs.paragraphs_type.image_gallery_item.yml new file mode 100644 index 000000000..e613d5a2a --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/config/optional/language/sv/paragraphs.paragraphs_type.image_gallery_item.yml @@ -0,0 +1 @@ +label: 'Fotogalleri objekt' diff --git a/modules/helfi_paragraphs_image_gallery/helfi_paragraphs_image_gallery.info.yml b/modules/helfi_paragraphs_image_gallery/helfi_paragraphs_image_gallery.info.yml new file mode 100644 index 000000000..e4045d026 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/helfi_paragraphs_image_gallery.info.yml @@ -0,0 +1,8 @@ +name: 'HELfi Paragraphs: Image Gallery' +type: module +core_version_requirement: '^9 || ^10' +dependencies: + - allowed_formats:allowed_formats + - helfi_base_content:helfi_base_content + - helfi_image_styles:helfi_image_styles + - helfi_media:helfi_media diff --git a/modules/helfi_paragraphs_image_gallery/helfi_paragraphs_image_gallery.module b/modules/helfi_paragraphs_image_gallery/helfi_paragraphs_image_gallery.module new file mode 100644 index 000000000..f6995441b --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/helfi_paragraphs_image_gallery.module @@ -0,0 +1,52 @@ + t('1:1'), + 'ratio_2_3' => t('2:3'), + 'ratio_3_2' => t('3:2'), + ]; + + return $ratio; +} diff --git a/modules/helfi_paragraphs_image_gallery/src/Entity/ImageGallery.php b/modules/helfi_paragraphs_image_gallery/src/Entity/ImageGallery.php new file mode 100644 index 000000000..41171a379 --- /dev/null +++ b/modules/helfi_paragraphs_image_gallery/src/Entity/ImageGallery.php @@ -0,0 +1,15 @@ +update($module); } } + +/** + * Enable image gallery paragraph. + */ +function helfi_platform_config_base_update_9004() : void { + $environmentResolver = \Drupal::getContainer()->get('helfi_api_base.environment_resolver'); + + try { + $environmentResolver->getActiveEnvironment(); + } + catch (\InvalidArgumentException) { + return; + } + + // Enable helfi_paragraphs_image_gallery. + if (!\Drupal::moduleHandler()->moduleExists('helfi_paragraphs_image_gallery')) { + Drupal::service('module_installer')->install(['helfi_paragraphs_image_gallery']); + } + + // Trigger updates for content liftup related modules. + $affected_modules = [ + 'helfi_node_landing_page', + 'helfi_node_page', + 'helfi_tpr_config', + ]; + + foreach ($affected_modules as $module) { + if (!\Drupal::moduleHandler()->moduleExists($module)) { + continue; + } + // Trigger updates for content liftup related modules. + \Drupal::service('helfi_platform_config.config_update_helper') + ->update($module); + } +} diff --git a/modules/helfi_tpr_config/helfi_tpr_config.module b/modules/helfi_tpr_config/helfi_tpr_config.module index 370a7c5da..f1f8d0088 100644 --- a/modules/helfi_tpr_config/helfi_tpr_config.module +++ b/modules/helfi_tpr_config/helfi_tpr_config.module @@ -56,6 +56,7 @@ function helfi_tpr_config_helfi_paragraph_types() : array { 'remote_video' => 7, 'columns' => 8, 'contact_card_listing' => 9, + 'image_gallery' => 10, ], 'field_lower_content' => [ 'list_of_links' => 0, @@ -72,6 +73,7 @@ function helfi_tpr_config_helfi_paragraph_types() : array { 'liftup_with_image' => 11, 'map' => 12, 'remote_video' => 13, + 'image_gallery' => 14, ], ], ], @@ -93,6 +95,7 @@ function helfi_tpr_config_helfi_paragraph_types() : array { 'contact_card_listing' => 12, 'unit_accessibility_information' => 13, 'unit_contact_card' => 14, + 'image_gallery' => 15, ], 'field_sidebar_content' => [ 'from_library' => 0, @@ -116,6 +119,7 @@ function helfi_tpr_config_helfi_paragraph_types() : array { 'phasing' => 14, 'unit_accessibility_information' => 15, 'unit_contact_card' => 16, + 'image_gallery' => 17, ], ], ],