继续Drupal分享精神 QQ群:107748121 站长QQ:2275288328 skype: hellodrupal【drupal交流+drupal 建站+theme制作】
登录 注册

drupal hook_node_info 的设置

钩子node_info 里面有很多设置属性,可以到这里http://api.drupal.org/api/function/hook_node_info/6 查找,有相关说明。 定义节点类型的名称和模块,描述等。下面一个locked 属性设置了不起作用,不知道是不是缓存问题,用drupal 6开发指南里面的例子joke,设置还是可以的,但是 更新一下就无效了。不知道是怎么回事。 * "name": the human-readable name of the node type. Required. * "module": a string telling Drupal how a module's functions map to hooks (i.e. if module is defined as example_foo, then example_foo_insert will be called when inserting a node of that type). This string is usually the name of the module in question, but not always. Required. * "description": a brief description of the node type. Required. * "help": text that will be displayed at the top of the submission form for this content type. Optional (defaults to ''). * "has_title": boolean indicating whether or not this node type has a title field. Optional (defaults to TRUE). * "title_label": the label for the title field of this content type. Optional (defaults to 'Title'). * "has_body": boolean indicating whether or not this node type has a body field. Optional (defaults to TRUE). * "body_label": the label for the body field of this content type. Optional (defaults to 'Body'). * "min_word_count": the minimum number of words for the body field to be considered valid for this content type. Optional (defaults to 0). * "locked": boolean indicating whether the machine-readable name of this content type can (FALSE) or cannot (TRUE) be edited by a site administrator. Optional (defaults to TRUE). 就按照上面的属性来定义了 array( //product 就是模块名称 也是衔接名词 add/product 这样的路径 'name' =>t('产品信息'), 'module' => 'product', 'description' => t('添加公司相关产品信息'), 'has_title' => TRUE, 'title_label' => t('木材名称'), 'has_body' => TRUE, 'body_label' => t('材性及用途'), 'min_word_count' => 10, 'locked' => TRUE ) ); } ?> 在后台创建内容下面应该可以看到菜单里。 每天进一步!

评论

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 自动断行和分段。
  • You can use BBCode tags in the text.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.