I am new to Drupal and I need to add an attribute to the HTML tag, but I cannot find the way. Thank you for the help.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
This probably depends in part on your theming mechanism. However, the doctype and html tags are likely hard-coded in page.tpl.php
or similar (located in sites/all/themes/themename). The exact file will depend on your theme.
For example, I have a site with the following in page.tpl.php
:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php print $language->language; ?>" lang="<?php print $language->language; ?>" dir="<?php print $language->dir; ?>">
As you can see, there is some information being injected by PHP. This would be the place for you to make your change.