diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..42b47af Binary files /dev/null and b/.DS_Store differ diff --git a/config/.DS_Store b/config/.DS_Store new file mode 100644 index 0000000..5ae3eee Binary files /dev/null and b/config/.DS_Store differ diff --git a/config/install/.DS_Store b/config/install/.DS_Store new file mode 100644 index 0000000..8a90088 Binary files /dev/null and b/config/install/.DS_Store differ diff --git a/config/install/core.entity_form_display.paragraph.call_to_action_image_logo.default.yml b/config/install/core.entity_form_display.paragraph.call_to_action_image_logo.default.yml new file mode 100644 index 0000000..238454a --- /dev/null +++ b/config/install/core.entity_form_display.paragraph.call_to_action_image_logo.default.yml @@ -0,0 +1,35 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.call_to_action_image_logo.field_feature_image + - field.field.paragraph.call_to_action_image_logo.field_paragraph_cta + - image.style.thumbnail + - paragraphs.paragraphs_type.call_to_action_image_logo + module: + - link + - svg_image +id: paragraph.call_to_action_image_logo.default +targetEntityType: paragraph +bundle: call_to_action_image_logo +mode: default +content: + field_feature_image: + type: image_image + weight: 1 + region: content + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + field_paragraph_cta: + type: link_default + weight: 0 + region: content + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } +hidden: + created: true + status: true diff --git a/config/install/core.entity_form_display.taxonomy_term.sites.default.yml b/config/install/core.entity_form_display.taxonomy_term.sites.default.yml index c34e653..59a6a38 100644 --- a/config/install/core.entity_form_display.taxonomy_term.sites.default.yml +++ b/config/install/core.entity_form_display.taxonomy_term.sites.default.yml @@ -24,10 +24,12 @@ dependencies: - taxonomy.vocabulary.sites module: - entity_browser + - field_group - file - link - maxlength - paragraphs + - svg_image - text third_party_settings: field_group: @@ -38,7 +40,7 @@ third_party_settings: label: 'Table of contents' region: content parent_name: '' - weight: 17 + weight: 15 format_type: details format_settings: classes: '' @@ -47,6 +49,67 @@ third_party_settings: open: false description: '' required_fields: true + group_site_theme_values: + children: + - field_site_theme_values + label: 'Site theme values' + region: content + parent_name: '' + weight: 17 + format_type: details + format_settings: + classes: '' + show_empty_fields: false + id: tide-site-theming-fileds + open: false + required_fields: true + effect: none + group_site_feature_flag_values: + children: + - field_site_feature_flags + label: 'Site feature flag values' + region: content + parent_name: '' + weight: 18 + format_type: details + format_settings: + classes: '' + show_empty_fields: false + id: tide-feature-flag-fields + open: false + required_fields: true + effect: none + group_site_favicon_value: + children: + - field_site_favicon + label: 'Site favicon value' + region: content + parent_name: '' + weight: 19 + format_type: details + format_settings: + classes: '' + show_empty_fields: false + id: tide-site-favicon-field + open: false + required_fields: true + effect: none + group_site_header_corner_graphic: + children: + - field_top_corner_graphic + - field_bottom_corner_graphic + label: 'Site header corner graphics' + region: content + parent_name: '' + weight: 21 + format_type: details + format_settings: + classes: '' + show_empty_fields: false + id: tide-site-header-corner-graphics + open: false + required_fields: true + effect: none id: taxonomy_term.sites.default targetEntityType: taxonomy_term bundle: sites @@ -54,12 +117,43 @@ mode: default content: field_acknowledgement_to_country: type: string_textarea - weight: 11 + weight: 10 region: content settings: rows: 5 placeholder: '' third_party_settings: { } + field_bottom_corner_graphic: + type: image_image + weight: 23 + region: content + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + field_paragraph_cta: + type: link_default + weight: 101 + region: content + settings: + placeholder_url: '' + placeholder_title: '' + third_party_settings: { } + field_paragraph_media: + type: entity_browser_entity_reference + weight: 102 + region: content + settings: + entity_browser: tide_image_browser + field_widget_display: rendered_entity + field_widget_edit: true + field_widget_remove: true + field_widget_replace: false + open: true + field_widget_display_settings: + view_mode: media_browser_preview + selection_mode: selection_append + third_party_settings: { } field_print_friendly_logo: type: file_generic weight: 3 @@ -69,7 +163,7 @@ content: third_party_settings: { } field_prominence_ack_to_country: type: string_textarea - weight: 12 + weight: 11 region: content settings: rows: 5 @@ -84,7 +178,7 @@ content: third_party_settings: { } field_site_domains: type: string_textarea - weight: 4 + weight: 3 region: content settings: rows: 3 @@ -95,9 +189,33 @@ content: maxlength_js_label: 'Content limited to @limit characters, remaining: @remaining' maxlength_js_enforce: false maxlength_js_truncate_html: false + field_site_favicon: + type: image_image + weight: 20 + region: content + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } + field_site_feature_flags: + type: key_value_textfield + weight: 19 + region: content + settings: + size: 60 + placeholder: '' + key_label: Key + value_label: Value + description_label: Description + description_rows: 5 + key_size: 60 + key_placeholder: '' + description_enabled: false + description_placeholder: '' + third_party_settings: { } field_site_footer_logos: type: entity_reference_paragraphs - weight: 8 + weight: 7 region: content settings: title: Paragraph @@ -195,6 +313,22 @@ content: maxlength: maxlength_js: 35 maxlength_js_label: 'Link text limited to @limit characters, remaining: @remaining' + field_site_theme_values: + type: key_value_textfield + weight: 18 + region: content + settings: + size: 60 + placeholder: '' + key_label: Key + value_label: Value + description_label: Description + description_rows: 5 + key_size: 60 + key_placeholder: '' + description_enabled: false + description_placeholder: '' + third_party_settings: { } field_site_twitter_image: type: entity_browser_entity_reference weight: 14 @@ -218,6 +352,14 @@ content: size: 60 placeholder: '' third_party_settings: { } + field_top_corner_graphic: + type: image_image + weight: 22 + region: content + settings: + progress_indicator: throbber + preview_image_style: thumbnail + third_party_settings: { } name: type: string_textfield weight: 0 @@ -226,6 +368,11 @@ content: size: 60 placeholder: '' third_party_settings: { } + simple_sitemap: + weight: 10 + region: content + settings: { } + third_party_settings: { } status: type: boolean_checkbox weight: 16 diff --git a/config/install/core.entity_view_display.paragraph.call_to_action_image_logo.default.yml b/config/install/core.entity_view_display.paragraph.call_to_action_image_logo.default.yml new file mode 100644 index 0000000..a6ce136 --- /dev/null +++ b/config/install/core.entity_view_display.paragraph.call_to_action_image_logo.default.yml @@ -0,0 +1,44 @@ +langcode: en +status: true +dependencies: + config: + - field.field.paragraph.call_to_action_image_logo.field_feature_image + - field.field.paragraph.call_to_action_image_logo.field_paragraph_cta + - paragraphs.paragraphs_type.call_to_action_image_logo + module: + - link + - svg_image +id: paragraph.call_to_action_image_logo.default +targetEntityType: paragraph +bundle: call_to_action_image_logo +mode: default +content: + field_feature_image: + type: image + label: above + settings: + image_link: '' + image_style: '' + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + third_party_settings: { } + weight: 1 + region: content + field_paragraph_cta: + type: link + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 0 + region: content +hidden: + search_api_excerpt: true diff --git a/config/install/core.entity_view_display.taxonomy_term.sites.default.yml b/config/install/core.entity_view_display.taxonomy_term.sites.default.yml index 3b7c974..417b793 100644 --- a/config/install/core.entity_view_display.taxonomy_term.sites.default.yml +++ b/config/install/core.entity_view_display.taxonomy_term.sites.default.yml @@ -24,6 +24,8 @@ dependencies: - entity_reference_revisions - file - link + - media + - svg_image - text id: taxonomy_term.sites.default targetEntityType: taxonomy_term @@ -35,7 +37,45 @@ content: label: above settings: { } third_party_settings: { } - weight: 9 + weight: 8 + region: content + field_bottom_corner_graphic: + type: image + label: above + settings: + image_link: '' + image_style: '' + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + third_party_settings: { } + weight: 20 + region: content + field_paragraph_cta: + type: link + label: above + settings: + trim_length: 80 + url_only: false + url_plain: false + rel: '' + target: '' + third_party_settings: { } + weight: 0 + region: content + field_paragraph_media: + type: media_thumbnail + label: above + settings: + image_link: '' + image_style: '' + image_loading: + attribute: lazy + third_party_settings: { } + weight: 1 region: content field_print_friendly_logo: type: file_default @@ -67,7 +107,30 @@ content: label: above settings: { } third_party_settings: { } - weight: 3 + weight: 2 + region: content + field_site_favicon: + type: image + label: above + settings: + image_link: '' + image_style: '' + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + third_party_settings: { } + weight: 18 + region: content + field_site_feature_flags: + type: key_value + label: above + settings: + value_only: false + third_party_settings: { } + weight: 17 region: content field_site_footer_logos: type: entity_reference_revisions_entity_view @@ -111,6 +174,8 @@ content: width: null height: null svg_render_as_image: true + image_loading: + attribute: lazy third_party_settings: { } weight: 1 region: content @@ -158,7 +223,15 @@ content: rel: '' target: '' third_party_settings: { } - weight: 14 + weight: 13 + region: content + field_site_theme_values: + type: key_value + label: above + settings: + value_only: false + third_party_settings: { } + weight: 16 region: content field_site_twitter_image: type: entity_reference_label @@ -174,7 +247,22 @@ content: settings: link_to_entity: false third_party_settings: { } - weight: 16 + weight: 15 + region: content + field_top_corner_graphic: + type: image + label: above + settings: + image_link: '' + image_style: '' + svg_attributes: + width: null + height: null + svg_render_as_image: true + image_loading: + attribute: lazy + third_party_settings: { } + weight: 19 region: content hidden: description: true diff --git a/config/install/field.field.paragraph.call_to_action_image_logo.field_feature_image.yml b/config/install/field.field.paragraph.call_to_action_image_logo.field_feature_image.yml new file mode 100644 index 0000000..3bc5270 --- /dev/null +++ b/config/install/field.field.paragraph.call_to_action_image_logo.field_feature_image.yml @@ -0,0 +1,37 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_feature_image + - paragraphs.paragraphs_type.call_to_action_image_logo + module: + - image +id: paragraph.call_to_action_image_logo.field_feature_image +field_name: field_feature_image +entity_type: paragraph +bundle: call_to_action_image_logo +label: 'Feature image' +description: '' +required: true +translatable: false +default_value: { } +default_value_callback: '' +settings: + handler: 'default:file' + handler_settings: { } + file_directory: '[date:custom:Y]-[date:custom:m]' + file_extensions: 'png gif jpg jpeg svg' + max_filesize: '' + max_resolution: '' + min_resolution: '' + alt_field: true + alt_field_required: true + title_field: false + title_field_required: false + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null +field_type: image diff --git a/config/install/field.field.paragraph.call_to_action_image_logo.field_paragraph_cta.yml b/config/install/field.field.paragraph.call_to_action_image_logo.field_paragraph_cta.yml new file mode 100644 index 0000000..6edb5d2 --- /dev/null +++ b/config/install/field.field.paragraph.call_to_action_image_logo.field_paragraph_cta.yml @@ -0,0 +1,36 @@ +langcode: en +status: true +dependencies: + config: + - field.storage.paragraph.field_paragraph_cta + - paragraphs.paragraphs_type.call_to_action_image_logo + module: + - link + - link_field_autocomplete_filter +third_party_settings: + link_field_autocomplete_filter: + negate: null + allowed_content_types: + alert: '0' + event: '0' + grant: '0' + landing_page: '0' + news: '0' + publication: '0' + publication_page: '0' + test: '0' + tide_search_listing: '0' +id: paragraph.call_to_action_image_logo.field_paragraph_cta +field_name: field_paragraph_cta +entity_type: paragraph +bundle: call_to_action_image_logo +label: CTA +description: '' +required: true +translatable: true +default_value: { } +default_value_callback: '' +settings: + title: 2 + link_type: 17 +field_type: link diff --git a/config/install/field.field.taxonomy_term.sites.field_site_footer_logos.yml b/config/install/field.field.taxonomy_term.sites.field_site_footer_logos.yml index 5ab5058..51d7e64 100644 --- a/config/install/field.field.taxonomy_term.sites.field_site_footer_logos.yml +++ b/config/install/field.field.taxonomy_term.sites.field_site_footer_logos.yml @@ -3,7 +3,7 @@ status: true dependencies: config: - field.storage.taxonomy_term.field_site_footer_logos - - paragraphs.paragraphs_type.call_to_action_image + - paragraphs.paragraphs_type.call_to_action_image_logo - taxonomy.vocabulary.sites module: - entity_reference_revisions @@ -23,9 +23,150 @@ settings: handler_settings: negate: 0 target_bundles: - call_to_action_image: call_to_action_image + call_to_action_image_logo: call_to_action_image_logo target_bundles_drag_drop: + accordion: + weight: 49 + enabled: false + accordion_content: + weight: 50 + enabled: false + banner: + weight: 51 + enabled: false + basic_text: + weight: 52 + enabled: false + call_to_action: + weight: 53 + enabled: false call_to_action_image: - enabled: true weight: 25 + enabled: false + call_to_action_image_logo: + weight: 55 + enabled: true + card_carousel: + weight: 56 + enabled: false + card_event: + weight: 57 + enabled: false + card_event_auto: + weight: 58 + enabled: false + card_keydates: + weight: 59 + enabled: false + card_promotion: + weight: 60 + enabled: false + card_promotion_auto: + weight: 61 + enabled: false + compact_card: + weight: 62 + enabled: false + compact_card_collection: + weight: 63 + enabled: false + complex_image: + weight: 64 + enabled: false + contact_us: + weight: 65 + enabled: false + content_collection: + weight: 66 + enabled: false + content_collection_enhanced: + weight: 67 + enabled: false + data_driven_component: + weight: 68 + enabled: false + data_table: + weight: 69 + enabled: false + embedded_search_form: + weight: 70 + enabled: false + embedded_webform: + weight: 71 + enabled: false + event_details: + weight: 72 + enabled: false + form_embed_openforms: + weight: 73 + enabled: false + hero_banner_with_cta: + weight: 74 + enabled: false + introduction_banner: + weight: 75 + enabled: false + key_journeys: + weight: 77 + enabled: false + keydates: + weight: 76 + enabled: false + latest_events: + weight: 78 + enabled: false + links: + weight: 79 + enabled: false + listing_content_type: + weight: 80 + enabled: false + listing_custom_filter: + weight: 81 + enabled: false + listing_site: + weight: 82 + enabled: false + listing_user_custom_filter: + weight: 83 + enabled: false + media_gallery: + weight: 84 + enabled: false + navigation_card: + weight: 85 + enabled: false + news_listing: + weight: 86 + enabled: false + phone: + weight: 87 + enabled: false + promotion_card: + weight: 88 + enabled: false + related_links: + weight: 89 + enabled: false + search_listing_header_component: + weight: 91 + enabled: false + searchable_fields: + weight: 90 + enabled: false + social_link: + weight: 92 + enabled: false + statistic_block: + weight: 94 + enabled: false + statistics_grid: + weight: 93 + enabled: false + timeline: + weight: 95 + enabled: false + timelines: + weight: 96 + enabled: false field_type: entity_reference_revisions diff --git a/config/install/field.storage.paragraph.field_feature_image.yml b/config/install/field.storage.paragraph.field_feature_image.yml new file mode 100644 index 0000000..5099f8f --- /dev/null +++ b/config/install/field.storage.paragraph.field_feature_image.yml @@ -0,0 +1,33 @@ +langcode: en +status: true +dependencies: + module: + - field_permissions + - file + - image + - paragraphs +third_party_settings: + field_permissions: + permission_type: public +id: paragraph.field_feature_image +field_name: field_feature_image +entity_type: paragraph +type: image +settings: + target_type: file + display_field: false + display_default: false + uri_scheme: public + default_image: + uuid: '' + alt: '' + title: '' + width: null + height: null +module: image +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/config/install/field.storage.taxonomy_term.field_site_footer_logos.yml b/config/install/field.storage.taxonomy_term.field_site_footer_logos.yml index e6a7a40..653c774 100644 --- a/config/install/field.storage.taxonomy_term.field_site_footer_logos.yml +++ b/config/install/field.storage.taxonomy_term.field_site_footer_logos.yml @@ -3,8 +3,12 @@ status: true dependencies: module: - entity_reference_revisions + - field_permissions - paragraphs - taxonomy +third_party_settings: + field_permissions: + permission_type: public id: taxonomy_term.field_site_footer_logos field_name: field_site_footer_logos entity_type: taxonomy_term diff --git a/config/install/paragraphs.paragraphs_type.call_to_action_image_logo.yml b/config/install/paragraphs.paragraphs_type.call_to_action_image_logo.yml new file mode 100644 index 0000000..4adc868 --- /dev/null +++ b/config/install/paragraphs.paragraphs_type.call_to_action_image_logo.yml @@ -0,0 +1,9 @@ +langcode: en +status: true +dependencies: { } +id: call_to_action_image_logo +label: 'Call to action image logo' +icon_uuid: null +icon_default: null +description: '' +behavior_plugins: { } diff --git a/tide_site.install b/tide_site.install index 8334805..3cd4936 100644 --- a/tide_site.install +++ b/tide_site.install @@ -5,6 +5,8 @@ * Install file for tide_site. */ + use Drupal\Component\Utility\NestedArray; + /** * Implements hook_install(). */ @@ -17,3 +19,54 @@ function tide_site_install() { } } } + +/** + * New field taxonomy image logo. + */ +function tide_site_update_10000() { + $configs = [ + 'paragraphs.paragraphs_type.call_to_action_image_logo' => 'paragraphs_type', + 'field.storage.paragraph.field_feature_image' => 'field_storage_config', + 'field.field.paragraph.call_to_action_image_logo.field_feature_image' => 'field_config', + 'field.field.paragraph.call_to_action_image_logo.field_paragraph_cta' => 'field_config', + 'core.entity_form_display.paragraph.call_to_action_image_logo.default' => 'entity_form_display', + 'core.entity_view_display.paragraph.call_to_action_image_logo.default' => 'entity_view_display', + + ]; + module_load_include('inc', 'tide_core', 'includes/helpers'); + $config_location = [\Drupal::service('extension.list.module')->getPath('tide_site') . '/config/install']; + // Check if field already exported to config/sync. + foreach ($configs as $config => $type) { + $config_read = _tide_read_config($config, $config_location, TRUE); + $storage = \Drupal::entityTypeManager()->getStorage($type); + $id = substr($config, strrpos($config, '.') + 1); + if ($storage->load($id) == NULL) { + $config_entity = $storage->createFromStorageRecord($config_read); + $config_entity->save(); + } + } + + $update_configs = [ + 'core.entity_view_display.taxonomy_term.sites.default' => 'entity_view_display', + 'core.entity_form_display.taxonomy_term.sites.default' => 'entity_form_display', + 'field.field.taxonomy_term.sites.field_site_footer_logos' => 'field_config', + 'field.storage.taxonomy_term.field_site_footer_logos' => 'field_storage_config', + ]; + foreach ($update_configs as $update_config => $type) { + $config_read = _tide_read_config($update_config, $config_location, FALSE); + $config = \Drupal::configFactory()->getEditable($update_config); + if (!$config) { + continue; + } + $data = $config->getRawData(); + foreach ($config_read as $key => $item) { + NestedArray::setValue($data, [ + $key, + ], NestedArray::getValue($config_read, [ + $key, + ])); + } + $config->setData($data)->save(); + } + +}