如何从 Drupal 6 中引用节点的字段动态填充节点形式的字段
对于一个项目,我有一个包含自定义内容的 Drupal 6 站点。 第一个是 A 类型的内容,包含文本字段 a1、a2、... 第二个是B类型的内容,有各种字段b1,b2,...以及任意数量的对A类型节点的节点引用。节点引用是通过自动完成小部件完成的。每个节点引用都与文本字段 b'1、b'2 一起位于字段组中...我希望 A 类型节点充当模板来填充这些字段,而无需提交表单。
更直接地说,我希望在选择对 A 类型节点的引用时,字段 b'1,... 填充有引用节点的 a1,... 的内容。 所有字段都是单行文本字段。
我已经阅读了很多可能的解决方案,但我有点迷失。从我所看到的来看,我应该使用 AHAH 并且也许制作一个模块。我尝试了很多模块,但没有一个令人满意。我对 Drupal(编写模块)的这一部分完全陌生,我很高兴能得到任何建议或指导。
谢谢!
For a project, I have a Drupal 6 site with custom contents.
The first one is the content of type A, with textfields a1, a2, ...
The second one is the content of type B, with various fields b1, b2, ... and a arbitrary number of node references to A-type nodes. The node reference is done via an autocomplete widget. Each node ref is in a fieldgroup along with textfields b'1, b'2... I want the A-type nodes to act as templates to populate these fields, without having to submit the form.
To be more direct, I want, at the moment I select the ref to the A-type node, the fields b'1,... to be populated with the content of a1,... of the referenced node.
All the fields are single lines textfields.
I've read a lot of possible solutions but I'm little lost. From what I've seen, I should use AHAH and maybe make a module. I've tried a lot of modules but none is satisfying. I'm totally new in this part of Drupal (writing modules), and I would be pleased to have any advice or direction.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不知道有哪个模块可以“开箱即用”地为您执行此操作。如果您想了解模块开发,模块开发人员指南是一个不错的起点:
http://drupal.org /node/206753
在您完成本教程后,我将研究如何创建您自己的内容类型。本教程将向您介绍 Form API,您最终将使用它来创建所需的 AHAH 表单。
http://drupal.org/node/231019
祝你好运!
I do not know of a module that can do this for you "out of the box". If you want to learn about module development, a good place to start is the module developers guide:
http://drupal.org/node/206753
After you've gone through the tutorial, I'd look into how you create your own content type. This tutorial will teach you about the Form API, which is what you will eventually use to create the AHAH form you need.
http://drupal.org/node/231019
Good luck!