我想定製$頭變量在我的page.tpl.php中的模板,因爲也有
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
出現兩種情況,我相信這是影響網站從使用W3C的標記驗證服務進行驗證。任何幫助將不勝感激,謝謝!
我想定製$頭變量在我的page.tpl.php中的模板,因爲也有
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
出現兩種情況,我相信這是影響網站從使用W3C的標記驗證服務進行驗證。任何幫助將不勝感激,謝謝!
這似乎是Drupal的API中的錯誤,討論在這裏可以遵循:
http://drupal.org/node/451304#comment-2632954
似乎連Drupal的。 org正在複製內容類型元標記。
那麼,首先我會試着弄清楚爲什麼你會得到重複的。手動刪除一個更像是一個破解而已。
也就是說,您可以使用template_preprocess_page自定義$頭。在你的主題的template.php文件,做這樣的事情:
<?php
function THEMENAME_preprocess_page(&$variables) {
// use $variables['head'] here and do whatever you want with it, such as...
$variables['head'] = str_replace('blah blah','blah',$variables['head']);
// ...although that's completely untested and might not work
}
是的,我試圖找出一個。檢查了我的.info文件和page.tpl.php文件,我沒有看到它可能來自哪裏。我知道那個預處理函數,但正如你所說,我正在試圖找出重複的來源。 – alvincrespo 2010-02-22 21:52:02