如何覆盖drupal主页的node.tpl文件?我尝试了各种
node--front.tpl.php
page--node--front.tpl.php
page--front--node.tpl.php
但它不起作用。
覆盖主页节点的文件名是什么? (我在drupal 7中工作)
最佳答案
您可以将此功能添加到主题template.php
function customethemename_preprocess_node ( &$vars ) {
if ($vars["is_front"]) {
$vars["theme_hook_suggestions"][] = "node__front";
}
}
然后您可以分页--front.tpl.php
它将解决问题
关于drupal - 如何覆盖首页节点tpl-drupal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12268607/