Reply to comment

jody on February 12, 2008 - 9:36am

Hi Alan,

I checked out that CCK theme README and yes it does explain how to make template files for individual fields. I think that most of the time that won’t be helpful to me. A good example of what I’m most often trying to do with my fields is to just stick a few of them in the same div in the node template. I think a better example of what I’m doing may be:

<?php
unset($node->content['field_dumb_field']);
unset(
$node->content['field_annoying']);
unset(
$node->content['#children']);
?>

<div class ="details">

<?php
print $node->content['field_a'];
unset(
$node->content['field_a']);
print
$node->content['field_b'];
unset(
$node->content['field_b']);
?>

</div>

</div class ="evertything-else">

<?php
foreach($node->content as $key => $field) {
    print
$field['#value'];  
  }
?>

</div>

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see and Markdown Extra for tables, footnotes, and more.

More information about formatting options