Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Drupal 6 在Drupal 6中创建节点/添加表单主题_Drupal 6 - Fatal编程技术网

Drupal 6 在Drupal 6中创建节点/添加表单主题

Drupal 6 在Drupal 6中创建节点/添加表单主题,drupal-6,Drupal 6,我在template.php文件中有一条语句,它指向一个自定义节点myccktype.tpl.php。我添加了一些DIV,这样我就可以有一个两列的node/add表单,但现在我试图找到print my fields,但似乎无法得到它 我基本上是这样使用的: <?php print form_render($form['field_sr_minutes']); ?> 对不起。由于您的.tpl文件名,我认为您正在尝试为节点视图设置主题。对于窗体,正确的函数不是form\u render

我在template.php文件中有一条语句,它指向一个自定义节点myccktype.tpl.php。我添加了一些DIV,这样我就可以有一个两列的node/add表单,但现在我试图找到print my fields,但似乎无法得到它

我基本上是这样使用的:

<?php print form_render($form['field_sr_minutes']); ?>

对不起。由于您的.tpl文件名,我认为您正在尝试为节点视图设置主题。对于窗体,正确的函数不是
form\u render
,而是
drupal\u render
。您基本上可以编写类似于echo drupal\u render($form['field\u sr\u minutes')的东西。。最后,请记住使用
drupal\u渲染($form)
来渲染所有未手动渲染的剩余内容。这将需要使表单正常工作

旧答案

node.tpl.php和其他内容 通过类型特定的.tpl.php
$node
中的完整节点对象。试着做 A.
drupal\u set\u消息(打印($node,TRUE))
在您的tpl文件的顶部。从那你 你能找出这条路的确切路线吗 需要打印的值

例如,节点的标题将是 在$node->title中提供。然而你 应始终小心使用
如果您要
打印用户提交的值。对于CCK
字段,您可以找到已存在的
$node->[0][view]
中的筛选值


.tpl中的drupal_set_消息(print_r($node,TRUE))不输出任何内容。$node->field_sr_status[0]['view']也没有,其中field_sr_status是我的字段的名称。对不起。我误解了你的问题。更新了答案。也许这会有帮助。我给你一个+1…你解决了一个让我发疯的问题^_^
Array
(
    [0] => Array
        (
            [#type] => textfield
            [#title] => Subject
            [#required] => 1
            [#default_value] => 
            [#maxlength] => 255
            [#weight] => -5
            [#post] => Array
                (
                )

            [#programmed] => 
            [#tree] => 
            [#parents] => Array
                (
                    [0] => title
                )

            [#array_parents] => Array
                (
                    [0] => title
                )

            [#processed] => 1
            [#description] => 
            [#attributes] => Array
                (
                )

            [#input] => 1
            [#size] => 60
            [#autocomplete_path] => 
            [#process] => Array
                (
                    [0] => form_expand_ahah
                )

            [#name] => title
            [#id] => edit-title
            [#value] => 
            [#defaults_loaded] => 1
            [#sorted] => 1
        )