Skip to content

Commit

Permalink
Merge pull request #317 from wri/WRI-474-meta-desc
Browse files Browse the repository at this point in the history
#474: add field_intro to region & simple page meta
  • Loading branch information
mariacha authored Sep 11, 2024
2 parents b8089b0 + e771907 commit e2f4282
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]'
18 changes: 18 additions & 0 deletions modules/wri_region/wri_region.install
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* @file
* Update hooks for wri_region.
*/

/**
* Update the metatags to display field_intro for description.
*/
function wri_region_update_10001() {
\Drupal::service('distro_helper.updates')->updateConfig('metatag.metatag_defaults.node__region', [
'tags#description',
], 'wri_region');

$message = 'Add field_intro to metatags description';
return $message;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
langcode: en
status: true
dependencies: { }
id: node__simple_page
label: 'Content: Simple Page'
tags:
description: '[node:field_intro]'
10 changes: 10 additions & 0 deletions modules/wri_simple_page/wri_simple_page.install
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit e2f4282

Please sign in to comment.