I have a regular field with multiple values, If i do
render( $fields['field1'] )
It prints
Field1_value1
Field1_value2
Field1_value3
etc
Am trying to get it to output like this
[Field1_value1]
[Field1_value2]
[Field1_value3]
etc
To add [
and ]
to the output.
I thought of using a foreach loop, but the field array is like such
'#title' => 'xxxx',
'#type' => 'xxxx',
...
'0' => <array>,
'1' => <array>,
'2' => <array>,
How can I get it to loop throught the [0], [1], [2] etc
only?
Note: I have no control on how many multiple values the field may have, so I have to loop.
Another solution that worked well for me: Display comma-separated list of taxonomy terms?
You can make use of the power of field.tpl.php.