Greetings,
I'm having trouble getting a CCK multi-value field to show inside my tab set using js_tabs. I'm following the typical js_tabs format but once I reach the point where I need to input the array field, it throws the "Unexpected: foreach" error.
Any ideas of how to properly write the code would be greatly appreciated.
$form = array();
$form['myformname'] = array(
'#type' => 'tabset',
);
//trimmed///
$form['myformname']['tab4'] = array(
'#type' => 'tabpage',
'#title' => t('Photos'),
'#content' => foreach ((array)$node->field_gallery as $item) {
'<div class="field-item">'.print $item['view']. '</div>';
},
'#weight' => '-5',
);
//trimmed///
return tabs_render($form);
TIA,
txcrew
Comments
Comment #1
Anonymous (not verified) commentedFigured it out from this post at groups.drupal.org:
http://groups.drupal.org/node/8359#comment-25496