Echo a specific element

How can I echo a specific element of a given Item Type? Also, how can I echo the name of an Item Type?

The new metadata function will echo out the data for both elements and for Item Types.

instead of, for example, array('Dublin Core', 'Title') , you would use array('Item Type Metadata', 'The Element')

I will try that and report back! Thanks!!

It seems I'm missing something here. Let's assume I have the "Sound" Item Type and I want to echo out the "Transcription" element.


<?php echo metadata('item', array('Sound', 'Transcription')); ?>

returns an Omeka error page...

Solved. This is it:

<?php echo metadata('item', array('Item Type Metadata', 'Transcription')); ?>

Still, I must figure out how can I echo only the Item Type name, i.e. Sound.


The item type name for the current item would be:

<?php echo metadata('item', 'item type name'); ?>

Thanks, John, it worked.

I'm trying this in the theme's (seasons) /items/show.php, located
between the <div id="primary">

<div id="primary">
<?php echo metadata('item', 'Title'); ?>
<?php echo metadata('item', array('Dublin Core', 'Title')); ?>

Would expect to see just the Dublin Core title label, and title contents; but instead get an Omeka error. Using vers. 2.0.1

The first echo metadata('item', 'Title'); is probably the culprit. You can delete that line, and the next one should work just fine.

<div id="primary">
<?php echo metadata('item', array('Dublin Core', 'Title')); ?>

Has the same effect as:

<div id="primary">


So maybe the theme's /items/show.php is not the best place to try to programmatically show/hide an element. I would love to be able to do this, since I use various fields (elements) in Item Type Metadata for many item types, and need to show/hide some of the elements based on user login (which is another issue altogether).

The other posting about application/views/helpers/AllElementTexts.php for this kind of thing seemed promising, but as indicated it may also affect the admin view.

A good plugin filter for elements is sorely needed.

That seems odd, since right above the primary div exactly the same code shows the item's title. Are there other alterations that might be causing us surprises?