diff --git a/modules/wri_region/config/install/metatag.metatag_defaults.node__region.yml b/modules/wri_region/config/install/metatag.metatag_defaults.node__region.yml index eacc1cd97..e8b97c67d 100644 --- a/modules/wri_region/config/install/metatag.metatag_defaults.node__region.yml +++ b/modules/wri_region/config/install/metatag.metatag_defaults.node__region.yml @@ -4,6 +4,7 @@ dependencies: { } id: node__region label: 'Content: Region' tags: + description: '[node:field_intro]' image_src: '[node:field_map_image:entity:field_media_image]' og_image: '[node:field_map_image:entity:field_media_image]' twitter_cards_image: '[node:field_map_image:entity:field_media_image]' diff --git a/modules/wri_region/wri_region.install b/modules/wri_region/wri_region.install new file mode 100644 index 000000000..27715e1e8 --- /dev/null +++ b/modules/wri_region/wri_region.install @@ -0,0 +1,18 @@ +updateConfig('metatag.metatag_defaults.node__region', [ + 'tags#description', + ], 'wri_region'); + + $message = 'Add field_intro to metatags description'; + return $message; +} diff --git a/modules/wri_simple_page/config/install/metatag.metatag_defaults.node__simple_page.yml b/modules/wri_simple_page/config/install/metatag.metatag_defaults.node__simple_page.yml new file mode 100644 index 000000000..fdbdb3545 --- /dev/null +++ b/modules/wri_simple_page/config/install/metatag.metatag_defaults.node__simple_page.yml @@ -0,0 +1,7 @@ +langcode: en +status: true +dependencies: { } +id: node__simple_page +label: 'Content: Simple Page' +tags: + description: '[node:field_intro]' diff --git a/modules/wri_simple_page/wri_simple_page.install b/modules/wri_simple_page/wri_simple_page.install index 2fec044c8..24c424162 100644 --- a/modules/wri_simple_page/wri_simple_page.install +++ b/modules/wri_simple_page/wri_simple_page.install @@ -27,3 +27,13 @@ function wri_simple_page_update_dependencies() { return $dependencies; } + +/** + * Update the metatags to display field_intro for description. + */ +function wri_simple_page_update_10001() { + \Drupal::service('distro_helper.updates')->installConfig('metatag.metatag_defaults.node__simple_page', 'wri_simple_page', 'install', 'TRUE'); + + $message = 'Add field_intro to metatags description'; + return $message; +}