Hi !

I'm following D7 userguide to learn module development and don't understand the way data is formatted to pass it to the view.

instruction, taken from the guide without modification

$block['content'] = theme('item_list', array('items' => $items));

$items is build like this (in a foreach($result as $node) loop)

$items[] = array('data' => l($node->title, 'node/' . $node->sid),);

In this exemple, it manages only one field : title. What if I need to manage two or more field ?

Is it like this : $items[] = array('data' => l($node->title, 'node/' . $node->sid), '???' => $node->date, ...and so on...);

Thanks a lot for helping

Eric

Comments

foxbille’s picture

Don't reply,

it a shame, i didn't read explanations about theming. item_list does not fit as i need an html table... and i found some help about the $items[] loading, its quite simple :

$items[] = array(t($node->date),l($node->title, 'node/' . $node->id),t($node->difficulte),);

 ... 

Thanks anyway...