【发布时间】:2016-02-26 15:00:34
【问题描述】:
我有很大的疑问...我添加内容的方式是否正确(例如发布者 google plus 的链接,或元标记或外部资源 css):
function mysubtheme_page_alter($page) {
$viewport = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'viewport',
'content' => 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no')
);
drupal_add_html_head($viewport, 'viewport');
$googleplus = array(
'#type' => 'html_tag',
'#tag' => 'link',
'#attributes' => array(
'href' => 'https://plus.google.com/+google-plus',
'rel' => 'publisher')
);
drupal_add_html_head($googleplus, 'googleplus');
$pinterest = array(
'#type' => 'html_tag',
'#tag' => 'meta',
'#attributes' => array(
'name' => 'p:domain_verify',
'content' => '7680eb52326ae9ee9e415d0ad')
);
drupal_add_html_head($pinterest, 'pinterest');
$fontawesome = array(
'#type' => 'html_tag',
'#tag' => 'link',
'#attributes' => array(
'href' => '/sites/font-awesome.min.css',
'rel' => 'stylesheet')
);
drupal_add_html_head($fontawesome, 'fontawesome');
}
我希望你能帮助我:) 对不起我的英语
edit 我问这个也是因为这些是我最新的更改,现在我注意到如果我登录并使用Firefox 查看我的网站,则没有 CSS!荒诞!
现在我有 3 种方法:
- 不正确如何在
head中添加内容 - 发行 Firefox (44.0.2)
- 问题模块 ADVANCED CSS/JS AGGREGATION
EDIT 2.0 这是 firefox 的问题(我重置它并解决了问题)......但是我想知道这种添加 head 的方式是否正确;)
【问题讨论】: