Drupal 添加“添加新”使用 PHP 代码链接
我有一个 cck 节点类型,其中包含对节点库类型的节点引用。由于我不想为我拥有的所有 CCK 节点实际创建一个新画廊,因此我想做以下操作。在显示cck节点的页面中;
如果给定节点存在图库引用,则显示该图库的链接。如果不存在画廊,我想显示一个链接“添加画廊”,理想情况下,这将以编程方式创建一个新的画廊节点和引用。我还想自动填充标题以及作者信息(而不授予用户访问权限)。我浏览了 drupal.org 试图找到信息,但无法弄清楚。
谢谢
I have a cck node type that contains a node reference to node gallery type. Since I don't want to actually create a new gallery for ever CCK node I have, I would like to do the fallowing. in the page that displays the cck node;
if the gallery reference exists for the given node, display a link to that gallery. If no gallery exists, I would like to display a link "add gallery", ideally, this would programatically create a new gallery node and reference. I would also like to automatically populate the title, as well as the author information (without giving the user access to this). I looked all over drupal.org to try and find the info but can't figure it out.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
获取当前节点的 nid :
或使用 CCK A 的任何字段值(您知道)并应用与节点表的联接
to get current node's nid :
or using any field value of CCK A (that you know) and applying a join with node table