I've just upgraded to Omeka 2.1.2. I was really pleased with my item output in my old version of Omeka, which had a custom.php file in my Berlin theme folder. I tried moving the custom.php file over to the new installation in the same place, but it's not working. I'd be grateful for any suggestions.
Thanks,
Karen
<?php
/**
* Show Item Metadata function that loops through an internal array of labels
* and their associated fields.
*
* @param Item|null $item
* @return string The HTML for the item metadata.
*/
function berlin_custom_item_metadata($item = null)
{
$html = '';
$item = $item ? $item : get_current_item();
// The list of fields we want to display, using 'Label' => item() Put them
// in the order you want them displayed. Add more to the array, separated
// by a comma.
$fields = array(
'Image' => item('Dublin Core', 'Rights', null, $item),
'Primary Source Text' => item('Item Type Metadata', 'Text', null, $item),
'Commentary' => item('Dublin Core', 'Description', null, $item),
'Source' => item('Dublin Core', 'Source', null, $item),
'Date' => item('Dublin Core', 'Date', null, $item),
'Further Reading' => item('Dublin Core', 'Relation', null, $item),
'Contributor' => item('Dublin Core', 'Contributor', null, $item)
);
// Loop through our array of fields, breaking out the label and value.
foreach ($fields as $label => $value) {
// Only display the field if it has a value.
if ($value) {
// Construct the HTML for displaying the label and value.
$html .= '<div class="field field-'. text_to_id($label) .'">'
. '<h2>'.$label.'</h2>'
. '<div class="field-value">'
. $value
. '</div>'
. '</div>';
}
}
return $html;
}