That’s a good question- using fieldgroups makes this even more complex. Here’s an idea showing some fields from a fieldgroup being explicitly displayed, and then anything else in the fieldgroup gets printed last.
<?php unset($node->content['#children']); ?>
<div class ="details">
<?php // A regular field print $node->content['field_a']; unset($node->content['field_a']); ?>
</div>
<div class ="group-special">
<?php //All fields within a certain fieldgroup foreach($node->content['group_special'] as $key => $groupfield) { if ($groupfield['#value']) { print $groupfield['#value']; } } unset($node->content['group_special']); ?>
</div>
</div class ="everything-else">
<?php //All other fields including those in other fieldgroups foreach($node->content as $key => $field) { if ($field['#value']) { print $field['#value']; } else { foreach($field as $groupfield) { if ($groupfield['#value']) { print $groupfield['#value']; } } } } ?>
jody on February 13, 2008 - 8:44pm
That’s a good question- using fieldgroups makes this even more complex. Here’s an idea showing some fields from a fieldgroup being explicitly displayed, and then anything else in the fieldgroup gets printed last.
<?php
unset($node->content['#children']);
?>
<div class ="details">
<?php
// A regular field
print $node->content['field_a'];
unset($node->content['field_a']);
?>
</div>
<div class ="group-special">
<?php
//All fields within a certain fieldgroup
foreach($node->content['group_special'] as $key => $groupfield) {
if ($groupfield['#value']) {
print $groupfield['#value'];
}
}
unset($node->content['group_special']);
?>
</div>
</div class ="everything-else">
<?php
//All other fields including those in other fieldgroups
foreach($node->content as $key => $field) {
if ($field['#value']) { print $field['#value']; }
else {
foreach($field as $groupfield) {
if ($groupfield['#value']) { print $groupfield['#value']; }
}
}
}
?>
</div>