Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function template_preprocess_my_detail_page(&$variables) {
- $items = $variables['item'];
- $title = $items->title;
- $og_title = [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:title',
- 'content' => $title,
- ],
- ];
- $variables['page']['#attached']['html_head'][] = [$og_title, 'og_title'];
- }
- function MY_MODULE_page_attachments_alter(array &$page) {
- $og_title = [
- '#tag' => 'meta',
- '#attributes' => [
- 'property' => 'og:title',
- 'content' => '',
- ],
- ];
- $page['#attached']['html_head'][] = [$og_title, 'og_title'];
- }
Add Comment
Please, Sign In to add comment