Skip to content

Commit

Permalink
Sg 369 custom meta tags (#239)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
aekong committed Oct 23, 2018
1 parent 95caeac commit 54a075e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web/themes/custom/sfgovpl/sfgovpl.theme
Expand Up @@ -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' => '',
]
];
Expand All @@ -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') {
Expand Down Expand Up @@ -77,7 +77,7 @@ function sfgovpl_preprocess_html(&$variables) {
$metaTxRelatedDept = [
'#tag' => 'meta',
'#attributes' => [
'name' => 'transaction-related-dept',
'name' => 'transactionRelatedDept',
'content' => '',
]
];
Expand All @@ -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'];
}
}
}

2 comments on commit 54a075e

@josh-chou
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created multidev environment sfgov#ci-1649.

Visit Site

@josh-chou
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created multidev environment sfgov#ci-1660.

Visit Site

Please sign in to comment.