主题是节点创建和节点编辑模板

时间:2010-05-06 22:51:11

标签: php drupal templates coding-style themes

我正在使用drupal 6.我设法为一种内容类型创建一个.tpl文件,即我的图片库中的图像。我通过在template.php中添加此代码来实现这一点:

function artbasic_theme($existing, $type, $theme, $path) {
  return array(
    'galleryimage_node_form' => array(
        'arguments' => array('form' => NULL),
        'template' => 'galleryimage_node_form'
    )
  );
}

然后我创建了galleryimage_node_form.tpl.php,很高兴。现在它发生了,所以我想为其他内容类型的表单提供其他模板文件,例如link_contrib_node_form.tpl.php。我已经尝试了几种方法来更改此功能以包含更多内容类型,但我无法弄清楚。有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

function artbasic_theme($existing, $type, $theme, $path) {
  return array(
    'galleryimage_node_form' => array(
        'arguments' => array('form' => NULL),
        'template' => 'galleryimage_node_form'
    ),
    'link_contrib_node_form' => array(
        'arguments' => array('form' => NULL),
        'template' => 'link_contrib_node_form'
    ),
  );
}
相关问题