一种为具有多个值的drupal cck字段创建动态循环的方法

时间:2011-01-26 02:18:22

标签: php drupal drupal-6 cck drupal-theming

我有一个类似于Drupal: Associating grouping more than one CCK field打印的链接列表,但多组模块不再有效(截至该帖后一个月)我一直在打印它们:

<?php if($node->field_committee_link[0][value]): ?><h4>1) <a href="<?php print $node->field_committee_link[0][value] ?>"><?php print $node->field_committee_link[0][value] ?></a></h4><?php endif; ?>
<?php if($node->field_link_descriptor[0][value]): ?><?php print '&nbsp;&nbsp;&nbsp;&nbsp;'. $node->field_link_descriptor[0][value] ?><?php endif; ?>

并更改数字

是他们的一种循环方式,例如

for $ node-&gt; field_committee_link [0] [value] to $ node-&gt; field_committee_link [x] [value] print $ node-&gt; field_committee_link [x] [value] x = i ++ 下

或者我需要预处理吗?

非常感谢

1 个答案:

答案 0 :(得分:2)

...试

foreach ($node->field_committee_link as $link) {
  print $link[value];
}