Multiple values for a single metadata entry

Hi. I'm using the below code in 2.0.4 to display metadata in a particular order. It works fine if there is a single value, but it won't display any secondary values for a given met data field. I found http://omeka.org/codex/Functions/item but it's for 1.x. I've tried foreach statements but can't seem to get it right. Any help would be greatly appreciated Thanks, Adam

' <?php if ($period = metadata('item', array('Item Type Metadata', 'Period'))): ?>
<div class="item-description-static">
<h3>Period:</h3>
<?php echo $period; ?>
</div>
<?php endif; ?>'

The documentation you're looking for is on our Read the Docs page.

In the third argument, you can pass options. array('all' => true) will return an array of all the values for that field you can loop over. array('delimiter' => 'some string') will return a string with all the values together, separated by the string you passed.

Thanks John. I tried the below code, but it only prints the word "Array", no quotes. Adam

' <?php if ($period = metadata('item', array('Item Type Metadata', 'Period'), array('all' => true))): ?>
<div class="item-description-static">
<h3>Period:</h3>
<?php echo $period; ?>
</div>
<?php endif; ?>'

I ended up using delimiter instead, and it worked fine. Thanks again.

' <?php if ($period = metadata('item', array('Item Type Metadata', 'Period'), array('delimiter'=>', '))): ?>
<div class="item-description-static">
<h3>Period:</h3>
<?php echo $period; ?>
</div>
<?php endif; ?>'