Rename Item Elements

So, I created a bunch of custom elements for an Item Type and now I want to change the display names for some of those elements on items/show.

I followed John's instructions to modify mytheme/common/record-metadata.php with something like this:

if ($setName == 'Item Type Metadata' && $elementName == 'Old Element Name') {
$label = 'New Name';
} else {
$label = __($elementName);
<h3><?php echo html_escape($label); ?></h3>

The else function seems to work fine. But the substitution is not happening, or it's being overwritten. I tried changing the original file at application/views/scripts/common and same problem. What is happening here? Am I missing something simple?

Here's a slightly different spin on that that has worked for me:

Thanks for the suggestion, but no luck. I copied the code exactly (swapping in if ($setName == 'Item Type Metadata'): and if ($elementName == 'The Default Item Type Element Name'):) and the element names remain exactly the same. When I removed <?php else: ?>
<h3><?php echo html_escape(__($elementName)); ?></h3>
, I ended up with *no* element names at all. So there is something wrong with the $customName variable. It's simply not working.

I do have John's awesome Hide Elements plugin enabled to mask a select few DC and Item Type elements from items/show. Could that be causing the problem?

I am truly baffled.


I tried disabling Hide Elements, and that didn't change anything. I also tried ($setName == 'Dublin Core') and that swapped the element names as it should. So the problem is with Item Type Metadata.

This is starting to feel like a bug in Omeka. (I'm on 2.1.4)

Ahhh! Item Type Metadata. There, the problem is that the set name is specific to the item type. E.g. "Text Item Type Metadata."

You might be better off with something like

if($setName != 'Dublin Core')

instead of

if($setName == 'Item Type Metadata')

You're a genius!

if($setName == 'Text Item Type Metadata')

worked like a charm. And the bug is in me. I assumed the specific name did not need to be given, since it's not given when echoing elements using the item() helper.

Glad it worked! I do think there could be a use for an "Any Item Type Metadata" set, though.

Yes, the Item Type Metadata set behaves a little weird: it gets the name of the Item Type prepended, but only when printing all the metadata at once.

Hide Elements itself has to do some fudgy workarounds to make things work right with the Item Type Metadata set.