0

I try to rewrite the node output and i don`t get it. This script produce only

<table></table>

without any content.

$rows = array();
$cols = array();

$cols[] = '<div id="node-title">' . $node->title[0]['value'] . '</div>';

$colnum = 0;

foreach($node->field_body as $col){
  $colnum++;
  $cols[] = '<div class="description" id="description-' . $colnum . '">' . $col['value'] . '</div>';
}

$rows[] = array('data' => $cols);

print theme('table', $rows) 
3

Variables to theme functions must be named:

print theme('table', array('rows' => $rows));

See the documentation for more details.

  • thx! now, it works! – Bruno Dec 25 '13 at 17:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.