【问题标题】:Theme the node-create and node-edit template主题 node-create 和 node-edit 模板
【发布时间】:2010-05-06 22:51:10
【问题描述】:

我正在使用 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。我尝试了几种方法来更改此功能以包含更多内容类型,但我无法弄清楚。有人可以帮忙吗?

【问题讨论】:

    标签: php drupal templates coding-style themes


    【解决方案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'
        ),
      );
    }
    

    【讨论】:

    • 我已经试过那个了。它没有任何效果,即使它看起来应该可以工作。
    • 其实我也是这么做的,还是不行。但是今天我再次启动电脑时,它突然工作了!也许是一些浏览器缓存之前阻止了,我不知道。还是谢谢!
    猜你喜欢
    • 1970-01-01
    • 2020-09-20
    • 2019-07-31
    • 1970-01-01
    • 2018-05-19
    • 1970-01-01
    • 2015-07-18
    • 2022-08-11
    • 1970-01-01
    相关资源
    最近更新 更多