0

我正在使用此函数在模块中注册一个 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(

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

4

1 回答 1

0

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

于 2011-11-29T15:00:56.843 回答