如何在drupal中获取内容类型的字段值 [英] How to get the field values of a content type in drupal
问题描述
如何获取自定义内容类型的字段值.我使用 CCK 模块创建了自定义内容类型.是否有任何函数可以获取特定内容类型的字段数组.
How can I get the field value of a custom content type. I have created a custom content type using the CCK module. Is there any function to get the array of the fields of a particular content type.
例如:我可以使用 content_profile_load() 函数获取配置文件详细信息.有没有类似的功能.
For example: I can get the profile details using content_profile_load() function. Is there any function similar to this.
推荐答案
如果您正在查看节点,则所有值都存储在 $node
变量中.做一个print_r($node);
查看节点对象中的所有可用值.
If you are viewing the node, the values are all stored in the $node
variable. Do a print_r($node);
to see all the available values in the node object.
否则使用 node_load() 加载节点对象.有关 node_load() 的更多信息:http://api.drupal.org/api/drupal/modules--node--node.module/function/node_load/7
Otherwise use node_load() to load a node object. More on node_load(): http://api.drupal.org/api/drupal/modules--node--node.module/function/node_load/7
这篇关于如何在drupal中获取内容类型的字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!