模块中的 Drupal 显示套件模板
我正在使用此函数在模块中注册 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(
不起作用。有人有想法吗?
I am using this function to register a tpl file in a module.
/**
* 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'),
),
);
}
this works fine, but is used for every node. I would like to apply it only to ds-1col--node-carousel-carousel.tpl.php, but
return array(
'ds_1col__node_carousel_carousel' => array(
does not work. Does anyone have an idea ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想重写特定的节点类型模板,您应该使用主题文件夹中的
node--nodetype.tpl.php
文件。If you want to rewrite specific node-type template you should use
node--nodetype.tpl.php
file in your theme's folder.