本文介绍了如何获取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.

否则使用no​​de_load()加载节点对象。 node_load()的更多信息:

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中的内容类型的字段值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 05:35
查看更多