模块中的Drupal显示套件模板

时间:2011-11-29 11:33:38

标签: templates drupal drupal-themes

我正在使用此函数在模块中注册tpl文件。

/**
 * Implementation of hook_theme().
 */
function frontpage_carousel_theme($existing) {
    return array(
        'ds_1col' => array(
            'arguments' => array(),
            'template' => 'ds-1col--node-carousel-carousel',
            'original hook' => 'ds_1col__node',
            'path' => drupal_get_path('module', 'frontpage_carousel') . '/templates',
            'type' => 'module',
            'preprocess functions' => array('template_preprocess', 'template_preprocess'),
        ),
    );
}

这很好用,但用于每个节点。我想将它仅应用于ds-1col - node-carousel-carousel.tpl.php,但是

return array(
            'ds_1col__node_carousel_carousel' => array(

不起作用。有没有人有想法?

1 个答案:

答案 0 :(得分:0)

如果要重写特定的节点类型模板,则应在主题文件夹中使用node--nodetype.tpl.php文件。

相关问题