From 54a075ea8abdaf6e4a14c328e9b7829fb6b5abd3 Mon Sep 17 00:00:00 2001 From: Anthony Kong Date: Tue, 23 Oct 2018 00:13:50 -0700 Subject: [PATCH] Sg 369 custom meta tags (#239) * sg-369 add custom meta tags for department and transaction nodes * sg-369 - custom meta tag, use a better var * sg-369 update robots.txt to allow funnelback to crawl * sg-369 add test for custom meta tag * sg-369 add test for custom meta tag for transaction * sg-369 remove test tag for test * escape double quotes * sg-369 add field specific meta * sg-369 account for missing info on custom meta tag for depts * sg-369 update test for meta tags * sg-369 custom meta tags - account for missing info for transactions * sg-369 change naming convention for custom metadata --- web/themes/custom/sfgovpl/sfgovpl.theme | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/web/themes/custom/sfgovpl/sfgovpl.theme b/web/themes/custom/sfgovpl/sfgovpl.theme index 084226f16e..2ea01a2577 100755 --- a/web/themes/custom/sfgovpl/sfgovpl.theme +++ b/web/themes/custom/sfgovpl/sfgovpl.theme @@ -22,14 +22,14 @@ function sfgovpl_preprocess_html(&$variables) { $metaDeptPhone = [ '#tag' => 'meta', '#attributes' => [ - 'name' => 'department-phone', + 'name' => 'departmentPhone', 'content' => '', ] ]; $metaDeptAddress = [ '#tag' => 'meta', '#attributes' => [ - 'name' => 'department-address', + 'name' => 'departmentAddress', 'content' => '', ] ]; @@ -47,8 +47,8 @@ function sfgovpl_preprocess_html(&$variables) { $metaDeptAddress['#attributes']['content'] = $address->field_address->address_line1; } - $variables['page']['#attached']['html_head'][] = [$metaDeptPhone, 'department-phone']; - $variables['page']['#attached']['html_head'][] = [$metaDeptAddress, 'department-address']; + $variables['page']['#attached']['html_head'][] = [$metaDeptPhone, 'departmentPhone']; + $variables['page']['#attached']['html_head'][] = [$metaDeptAddress, 'departmentAddress']; } if($nodeType == 'transaction') { @@ -77,7 +77,7 @@ function sfgovpl_preprocess_html(&$variables) { $metaTxRelatedDept = [ '#tag' => 'meta', '#attributes' => [ - 'name' => 'transaction-related-dept', + 'name' => 'transactionRelatedDept', 'content' => '', ] ]; @@ -87,7 +87,7 @@ function sfgovpl_preprocess_html(&$variables) { $metaTxRelatedDept['#attributes']['content'] = $oneRelatedDept->getTitle(); } $variables['page']['#attached']['html_head'][] = [$metaTx, 'transaction']; - $variables['page']['#attached']['html_head'][] = [$metaTxRelatedDept, 'transaction-related-dept']; + $variables['page']['#attached']['html_head'][] = [$metaTxRelatedDept, 'transactionRelatedDept']; } } } \ No newline at end of file