douxi3977 2010-09-08 21:51
浏览 55
已采纳

在Drupal中将字段内容从“父”节点带到“子”节点

What I need to do is bring data from a field in a "parent" node to a "child" node. Something like the following:

$myactive_trail = menu_get_active_trail();
$parent = $myactive_trail['2']['link_path'];
print $parent->field_video['0']['filepath'];

I know that there is not such thing as a parent not hence me trying to use menu_get_active_trail(). I can print the $parent link_path, but don't know how to call up a field from the parent node.

  • 写回答

1条回答 默认 最新

  • dpf5207 2010-09-28 00:22
    关注

    I was in a similar position. CCK Node references are quite useful, and actually rather simple once you know how to manipulate them. If I understand your question correctly... I believe you want to add parts of the "parent" node type when you display the "child" node type. If that's right, there is a tutorial video that explains how to do EXACTLY that. It also gives pointers on actually setting up a CCK node reference.

    http://geoffhankerson.com/drupal/cck-nodereference-screencast.html

    Hope this helps!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信小程序协议怎么写
  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看