dongshungai4857 2014-05-05 12:02
浏览 96
已采纳

每个节点类型覆盖html.tpl.php不起作用

I saw that this was asked few times before, and i tried the answers, and i tried modifying the answers, yet nothing.

Case: I have advanced forums installed, and i am using appcache(don't you dear to run away now!) Obviously i need to turn appcache off when surffing forums, and i managed to make custom html.tpl.html for /forum and /forums, so when i am looking forum list and topic list i wont get cached. But then: When i am looking at forum topic, it is a post ofc, and post type (machine type is forum) and i have defined in template.php:

function flowrox_preprocess_html(&$vars) {
    $node = menu_get_object();

    if ($node && $node->nid) {
        $vars['theme_hook_suggestion'][] = 'html__' . $node->type;
    }
}

and it wont make change.

So i am able to change html.tpl.php for path but not for node type. Help me please and correct my knowledge for making such things.

Thanks for all!!! (btw i dont need a lesson of appcache, sincerely if you have manifest = x.appcache" in your html tag it will cache it, even if it's in network section)

  • 写回答

2条回答 默认 最新

  • duanbi5906 2014-05-05 12:42
    关注

    O M G, I feel so sorry for you now.

    It should be $vars['theme_hook_suggestions'] and not $vars['theme_hook_suggestion'] (the s at the end of suggestion)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?