Drupal:CCK API 文档
有什么好的 CCK API 文档吗?我看过 http://api.audean.com/,但找不到我想要的东西。
基本上,我需要一个函数,它接受字段名称并返回具有该字段的节点类型。我自己写的,但更愿意进行 API 调用。
Any good CCK API docs out there? I have seen http://api.audean.com/, but can't find what I want there.
Basically, I need a function that takes a field name and returns what node type has that field. I wrote my own, but would rather make an API call.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CCK 是一个很棒的模块,但它的文档很糟糕且过时。 :(
查看模块文件发现 content_fields($field_name) 可能提供您正在寻找的功能。
该函数接受字段名称并返回该字段的所有设置的数组。
节点类型存储在 ['type_name'] 中,因此您可以编写如下内容:
这将为您提供 field_myfield 的节点类型。
CCK is an awesome module but has terrible, outdated documentation. :(
Looking through the module files revealed content_fields($field_name) which may provide the functionality you are looking for.
The function takes in the field name and returns an array of all the settings for that field.
The node type is stored in ['type_name'] so you could write something like the following:
That should give you the node type for field_myfield.