开发者

a way to create a dynamic loop for a drupal cck field with multiple values

i have a list of links that i want to print similar to Drupal: Associating grouping more than one CCK field but the multigroup module is no longer active (as of like a month after that post) i have been printing them like so:

<?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; ?>

and changing the numbers

is their a way to loop through such as

for $node->field_committee_link[0][value] to $node->field_committee_link[x][value] pri开发者_JAVA技巧nt $node->field_committee_link[x][value] x= i++ next

or would i need to preprocess this?

help greatly appreciated


Try...

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜