diff --git a/openy_node/modules/openy_node_event/config/install/core.entity_form_display.node.event.default.yml b/openy_node/modules/openy_node_event/config/install/core.entity_form_display.node.event.default.yml index 96eaa711..44b813f2 100644 --- a/openy_node/modules/openy_node_event/config/install/core.entity_form_display.node.event.default.yml +++ b/openy_node/modules/openy_node_event/config/install/core.entity_form_display.node.event.default.yml @@ -3,6 +3,9 @@ status: true dependencies: config: - entity_browser.browser.images_library + - field.field.node.event.field_contact_email + - field.field.node.event.field_contact_name + - field.field.node.event.field_contact_phone - field.field.node.event.field_content - field.field.node.event.field_event_dates - field.field.node.event.field_event_description @@ -26,29 +29,48 @@ third_party_settings: - field_event_image - field_event_description - field_content + label: 'Content Area' + region: hidden parent_name: '' - weight: 3 + weight: 17 format_type: tab format_settings: - id: '' classes: '' + id: '' formatter: closed description: '' required_fields: true - label: 'Content Area' group_sidebar_area: children: - field_sidebar_content + label: 'Sidebar Area' + region: hidden parent_name: '' - weight: 4 + weight: 18 format_type: tab format_settings: + classes: '' id: '' + formatter: closed + description: '' + required_fields: true + group_location_info: + children: + - field_contact_name + - field_contact_phone + - field_contact_email + label: 'Location info' + region: content + parent_name: '' + weight: 2 + format_type: tab + format_settings: classes: '' + show_empty_fields: false + id: '' formatter: closed description: '' required_fields: true - label: 'Sidebar Area' id: node.event.default targetEntityType: node bundle: event @@ -56,19 +78,45 @@ mode: default content: addthis: type: boolean_checkbox + weight: 8 + region: content settings: display_label: true - weight: 9 - region: content third_party_settings: { } created: type: datetime_timestamp - weight: 7 + weight: 6 region: content settings: { } third_party_settings: { } + field_contact_email: + type: email_default + weight: 18 + region: content + settings: + placeholder: '' + size: 60 + third_party_settings: { } + field_contact_name: + type: string_textfield + weight: 16 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + field_contact_phone: + type: string_textfield + weight: 17 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } field_content: + type: entity_reference_paragraphs weight: 17 + region: content settings: title: Paragraph title_plural: Paragraphs @@ -77,44 +125,45 @@ content: form_display_mode: default default_paragraph_type: '' third_party_settings: { } - type: entity_reference_paragraphs - region: content field_event_dates: - weight: 2 - settings: { } - third_party_settings: { } type: daterange_default + weight: 3 region: content + settings: { } + third_party_settings: { } field_event_description: + type: text_textarea weight: 16 + region: content settings: rows: 5 placeholder: '' third_party_settings: { } - type: text_textarea - region: content field_event_image: + type: entity_browser_entity_reference weight: 15 + region: content settings: entity_browser: images_library field_widget_display: rendered_entity field_widget_edit: true field_widget_remove: true - selection_mode: selection_append + field_widget_replace: false + open: false field_widget_display_settings: view_mode: thumbnail_for_preview - open: false + selection_mode: selection_append third_party_settings: { } - type: entity_browser_entity_reference - region: content field_event_location: + type: options_select weight: 1 + region: content settings: { } third_party_settings: { } - type: options_select - region: content field_sidebar_content: + type: entity_reference_paragraphs weight: 16 + region: content settings: title: Paragraph title_plural: Paragraphs @@ -123,11 +172,9 @@ content: form_display_mode: default default_paragraph_type: '' third_party_settings: { } - type: entity_reference_paragraphs - region: content langcode: type: language_select - weight: 5 + weight: 4 region: content settings: include_locked: true @@ -135,8 +182,8 @@ content: moderation_state: type: moderation_state_default weight: 14 - settings: { } region: content + settings: { } third_party_settings: { } path: type: path @@ -146,10 +193,10 @@ content: third_party_settings: { } promote: type: boolean_checkbox + weight: 7 + region: content settings: display_label: true - weight: 8 - region: content third_party_settings: { } publish_on: type: datetime_timestamp_no_default @@ -157,19 +204,32 @@ content: region: content settings: { } third_party_settings: { } + redirect: + type: string_textfield + weight: 15 + region: content + settings: + size: 60 + placeholder: '' + third_party_settings: { } + simple_sitemap: + weight: 10 + region: content + settings: { } + third_party_settings: { } status: type: boolean_checkbox + weight: 14 + region: content settings: display_label: true - weight: 15 - region: content third_party_settings: { } sticky: type: boolean_checkbox + weight: 9 + region: content settings: display_label: true - weight: 10 - region: content third_party_settings: { } title: type: string_textfield @@ -181,12 +241,13 @@ content: third_party_settings: { } uid: type: entity_reference_autocomplete - weight: 6 + weight: 5 + region: content settings: match_operator: CONTAINS + match_limit: 10 size: 60 placeholder: '' - region: content third_party_settings: { } unpublish_on: type: datetime_timestamp_no_default @@ -194,4 +255,9 @@ content: region: content settings: { } third_party_settings: { } + url_redirects: + weight: 16 + region: content + settings: { } + third_party_settings: { } hidden: { } diff --git a/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.default.yml b/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.default.yml index 03d9e1a5..060be5e3 100644 --- a/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.default.yml +++ b/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.default.yml @@ -2,6 +2,9 @@ langcode: en status: true dependencies: config: + - field.field.node.event.field_contact_email + - field.field.node.event.field_contact_name + - field.field.node.event.field_contact_phone - field.field.node.event.field_content - field.field.node.event.field_event_dates - field.field.node.event.field_event_description @@ -20,71 +23,75 @@ bundle: event mode: default content: addthis: - label: hidden type: boolean - weight: 6 - region: content + label: hidden settings: format: default format_custom_false: '' format_custom_true: '' third_party_settings: { } + weight: 6 + region: content field_content: - weight: 3 + type: entity_reference_revisions_entity_view label: hidden settings: view_mode: default link: '' third_party_settings: { } - type: entity_reference_revisions_entity_view + weight: 3 region: content field_event_dates: - weight: 5 + type: daterange_default label: hidden settings: timezone_override: '' format_type: medium separator: '-' third_party_settings: { } - type: daterange_default + weight: 5 region: content field_event_description: - weight: 2 + type: text_default label: hidden settings: { } third_party_settings: { } - type: text_default + weight: 2 region: content field_event_image: - weight: 1 + type: entity_reference_entity_view label: hidden settings: - link: true view_mode: default + link: true third_party_settings: { } - type: entity_reference_entity_view + weight: 1 region: content field_event_location: - weight: 4 + type: entity_reference_label label: hidden settings: link: true third_party_settings: { } - type: entity_reference_label + weight: 4 region: content field_sidebar_content: - weight: 7 + type: entity_reference_revisions_entity_view label: hidden settings: view_mode: default link: '' third_party_settings: { } - type: entity_reference_revisions_entity_view + weight: 7 region: content links: - weight: 0 - region: content settings: { } third_party_settings: { } + weight: 0 + region: content hidden: + field_contact_email: true + field_contact_name: true + field_contact_phone: true langcode: true + search_api_excerpt: true diff --git a/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.full.yml b/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.full.yml index e789cebd..6c3a1b0f 100644 --- a/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.full.yml +++ b/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.full.yml @@ -3,6 +3,9 @@ status: true dependencies: config: - core.entity_view_mode.node.full + - field.field.node.event.field_contact_email + - field.field.node.event.field_contact_name + - field.field.node.event.field_contact_phone - field.field.node.event.field_content - field.field.node.event.field_event_dates - field.field.node.event.field_event_description @@ -21,71 +24,75 @@ bundle: event mode: full content: addthis: - label: hidden type: boolean - weight: 6 - region: content + label: hidden settings: format: default format_custom_false: '' format_custom_true: '' third_party_settings: { } + weight: 6 + region: content field_content: - weight: 3 + type: entity_reference_revisions_entity_view label: hidden settings: view_mode: default link: '' third_party_settings: { } - type: entity_reference_revisions_entity_view + weight: 3 region: content field_event_dates: - weight: 5 + type: daterange_default label: hidden settings: - separator: '-' - format_type: medium timezone_override: '' + format_type: medium + separator: '-' third_party_settings: { } - type: daterange_default + weight: 5 region: content field_event_description: - weight: 2 + type: text_default label: hidden settings: { } third_party_settings: { } - type: text_default + weight: 2 region: content field_event_image: - weight: 1 + type: entity_reference_entity_view label: hidden settings: view_mode: embedded_full link: false third_party_settings: { } - type: entity_reference_entity_view + weight: 1 region: content field_event_location: - weight: 4 + type: entity_reference_label label: hidden settings: link: true third_party_settings: { } - type: entity_reference_label + weight: 4 region: content field_sidebar_content: - weight: 7 + type: entity_reference_revisions_entity_view label: hidden settings: view_mode: default link: '' third_party_settings: { } - type: entity_reference_revisions_entity_view + weight: 7 region: content links: - weight: 0 - region: content settings: { } third_party_settings: { } + weight: 0 + region: content hidden: + field_contact_email: true + field_contact_name: true + field_contact_phone: true langcode: true + search_api_excerpt: true diff --git a/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.teaser.yml b/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.teaser.yml index 655e61bd..1d2ee2b9 100644 --- a/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.teaser.yml +++ b/openy_node/modules/openy_node_event/config/install/core.entity_view_display.node.event.teaser.yml @@ -3,6 +3,9 @@ status: true dependencies: config: - core.entity_view_mode.node.teaser + - field.field.node.event.field_contact_email + - field.field.node.event.field_contact_name + - field.field.node.event.field_contact_phone - field.field.node.event.field_content - field.field.node.event.field_event_dates - field.field.node.event.field_event_description @@ -22,35 +25,39 @@ mode: teaser content: field_event_dates: type: daterange_default - weight: 1 - region: content label: hidden settings: - separator: '-' - format_type: medium timezone_override: '' + format_type: medium + separator: '-' third_party_settings: { } + weight: 1 + region: content field_event_image: type: media_thumbnail - weight: 0 - region: content label: hidden settings: - image_style: event_teaser image_link: '' + image_style: event_teaser third_party_settings: { } + weight: 0 + region: content field_event_location: type: entity_reference_label - weight: 2 - region: content label: hidden settings: link: true third_party_settings: { } + weight: 2 + region: content hidden: addthis: true + field_contact_email: true + field_contact_name: true + field_contact_phone: true field_content: true field_event_description: true field_sidebar_content: true langcode: true links: true + search_api_excerpt: true diff --git a/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_email.yml b/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_email.yml new file mode 100644 index 00000000..6f262d33 --- /dev/null +++ b/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_email.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_contact_email + - node.type.event +id: node.event.field_contact_email +field_name: field_contact_email +entity_type: node +bundle: event +label: 'Contact Email' +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: email diff --git a/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_name.yml b/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_name.yml new file mode 100644 index 00000000..295b4eee --- /dev/null +++ b/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_name.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_contact_name + - node.type.event +id: node.event.field_contact_name +field_name: field_contact_name +entity_type: node +bundle: event +label: 'Contact Name' +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_phone.yml b/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_phone.yml new file mode 100644 index 00000000..c6cb22d2 --- /dev/null +++ b/openy_node/modules/openy_node_event/config/optional/field.field.node.event.field_contact_phone.yml @@ -0,0 +1,18 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.node.field_contact_phone + - node.type.event +id: node.event.field_contact_phone +field_name: field_contact_phone +entity_type: node +bundle: event +label: 'Contact Phone' +description: '' +required: false +translatable: true +default_value: { } +default_value_callback: '' +settings: { } +field_type: string diff --git a/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_email.yml b/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_email.yml new file mode 100644 index 00000000..963620ba --- /dev/null +++ b/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_email.yml @@ -0,0 +1,17 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_contact_email +field_name: field_contact_email +entity_type: node +type: email +settings: { } +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_name.yml b/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_name.yml new file mode 100644 index 00000000..297e6412 --- /dev/null +++ b/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_name.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_contact_name +field_name: field_contact_name +entity_type: node +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/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_phone.yml b/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_phone.yml new file mode 100644 index 00000000..76723c78 --- /dev/null +++ b/openy_node/modules/openy_node_event/config/optional/field.storage.node.field_contact_phone.yml @@ -0,0 +1,20 @@ +langcode: en +status: true +dependencies: + module: + - node +id: node.field_contact_phone +field_name: field_contact_phone +entity_type: node +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/openy_node/modules/openy_node_event/openy_node_event.install b/openy_node/modules/openy_node_event/openy_node_event.install index 7d9810b7..47c1ed40 100644 --- a/openy_node/modules/openy_node_event/openy_node_event.install +++ b/openy_node/modules/openy_node_event/openy_node_event.install @@ -39,3 +39,30 @@ function openy_node_event_update_8003() { 'image.style.event_teaser', ]); } + +/** + * Apply Webp to all image styles. + */ +function openy_node_event_update_9001() { + $path = \Drupal::service('extension.list.module')->getPath('openy_node_event') . '/config/optional'; + $config_importer = \Drupal::service('config_import.importer'); + $config_importer->setDirectory($path); + $config_importer->importConfigs([ + 'field.field.node.event.field_contact_email', + 'field.field.node.event.field_contact_name', + 'field.field.node.event.field_contact_phone', + 'field.storage.node.field_contact_email', + 'field.storage.node.field_contact_name', + 'field.storage.node.field_contact_phone', + ]); + + $path = \Drupal::service('extension.list.module')->getPath('openy_node_event') . '/config/install'; + $config_importer->setDirectory($path); + $config_importer->importConfigs([ + 'core.entity_form_display.node.event.default', + 'core.entity_view_display.node.event.default', + 'core.entity_view_display.node.event.full', + 'core.entity_view_display.node.event.teaser', + ]); + +} diff --git a/openy_node/modules/openy_node_event/openy_node_event.module b/openy_node/modules/openy_node_event/openy_node_event.module index 44310737..e6cd6e64 100644 --- a/openy_node/modules/openy_node_event/openy_node_event.module +++ b/openy_node/modules/openy_node_event/openy_node_event.module @@ -120,14 +120,15 @@ function openy_node_event_preprocess_field__node__field_event_location__event(&$ '#info' => $datesInfo, '#atc' => $datesAtc, ]; + $email = $node->field_contact_email->value ?? $location->field_location_email->value; $renderContact = [ '#theme' => 'event_contact_info', '#info' => [ - 'phone' => $location->field_location_phone->value, + 'phone' => $node->field_contact_phone->value ?? $location->field_location_phone->value, 'fax' => $location->field_location_fax->value, - 'email' => !empty($location->field_location_email->value) ? Link::fromTextAndUrl( - $location->field_location_email->value, - Url::fromUri('mailto:' . $location->field_location_email->value, + 'email' => !empty($email) ? Link::fromTextAndUrl( + $email, + Url::fromUri('mailto:' . $email, ['attributes' => ['target' => '_blank']]) ) : '', ],