【发布时间】:2018-04-04 16:59:55
【问题描述】:
在我的主题供应商文件中:
$element = array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'viewport',
'content' => 'width=device-width, initial-scale=1.0',
),
);
drupal_add_html_head($element, 'bootstrap_responsive');
我不想碰那个文件,但我想在其他地方覆盖这个设置。我当然可以:
drupal_add_html_head(array(
'#tag' => 'meta',
'#attributes' => array(
'name' => 'viewport',
'content' => 'maximum-scale=1.0' // Change is here
)
), 'bootstrap_responsive_2');
这可行,但也很丑陋,因为它最终会创建 2 个元标记。
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="maximum-scale=1.0" />
我可以简单地覆盖已经添加的元标记吗?
【问题讨论】:
标签: drupal drupal-7 drupal-theming