1
votes

I'm using CCK fields in my drupal node type. There's a field called field_signs, which is type Text / Checkboxes and it contains some values. What i want is to print those values in node template. But i don't know how to do this. I tried this:

<?php
echo $node->field_signs[0]['value'];
?>

But this prints ONLY the first checked value from all checked values.

Any idea?

Thanks

// EDIT // Maybe i found a solution.

<?php
$i = 0;
while (!$end) {
  if(array_key_exists($i, $node->field_test)) {
  echo $node->field_test[$i]['value'];
  $i++;
  } else {
  $end = TRUE;
  }
}
?>

If you have better solution, feel free to share with me.

1

1 Answers

1
votes
  1. Go to http://YOUR_DRUPAL_HOST/admin/content/node-type/YOUR_CONTENT_TYPE/template
  2. Click Body
  3. Click Body Variables

OR

  1. Administer
  2. Content Types
  3. Edit
  4. Template
  5. Body
  6. Body Variables

Now you can see all your variables and how to print them.