Drupal Web 服务模块和 ImageField CCK
使用带有 Services 2.2 的 Drupal 6,我可以创建标题和正文填充良好的节点。我还可以上传图片。但我无法填充 imageField CCK 字段。另外,我有一个无法填充的自定义 node_reference 字段。
有什么想法或示例服务吗? 谢谢
Using Drupal 6 with Services 2.2, I can create nodes with title and body populated fine. I can also upload an image. But I can't populate the imageField CCK field. Also, I have a custom node_reference field that I cannot populate.
Any ideas or example services?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有任何临时代码,但您想要做的是像这样填充 CCK 字段:
请注意,如果您有多张照片,则需要循环并包含索引来代替 0。最后,当你保存node_save,Drupal将完成剩下的工作。如果一切顺利,它将用您引用的照片填充 cck 字段。
创建一个带有照片的节点,然后转储节点对象,它将向您显示结构。我已经为一些具有 SOAP 服务的站点完成了此操作。
当构建节点对象时,CCK 字段通常在此结构中完成:
I don't have any code offhand, but what you want to do is populate the CCK field like this:
Note that if you have multiple photos, you will need to loop and include the index in place of 0. At the end, when you node_save, Drupal will do the rest of the work. If all goes well, it will populate the cck field with the photo you are referencing.
Create a node with a photo, then dump the node object and it will show you the structure. I have done this for a handful of sites with SOAP services.
CCK fields are typically done in this structure when building a node object: