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

Drupal CCK 自定义字段开发,cck组合字段开发api简介

在使用cck过程中,可能遇到需要自己来开发特定的字段组合。这时只需要使用cck提供的api 即可完成复杂组合字段开发。
这里主要介绍几个常用的cck 开发的api。

<?php



hook_field_info
(). //使用field_info 定义field基本属性

hook_field_settings() //主要来定义field各种需要的初始化设置变量,还有field的数据结构等

hook_field() //在这里可以对field验证,已经处理field浏览前的数据预处理等

hook_content_is_empty()  //根据传递过的field值是否为空,传递给cck,true or false

hook_field_formatter_info() //自定义数据处理formatter 信息。默认为default。多个field types 可以共用一个formatter.

theme_modulename_formatter_default //给formatter 定义theme。 前提是要先使用
hook_theme进行注册 modulename_formatter_default

hook_widget_info
() //可以定义widget,可以对一个field type定义多个widgets。需要指定给特定的field type

hook_elements()//定义elements

hook_widget() //可以处理widget表单里的显示值



//基本的几个cck 组合字段开发的api
?>

先总结这些......

评论

博主很厉害,向你学习。 =================

博主很厉害,向你学习。

=============================
mozila

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 自动断行和分段。
  • 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.