Forums » Restricting metadata fields to display

RSS feed for this topic

Info

  1. I'm trying to display only certain metadata fields for our items. There's a note in item.php about examples in the codex, but searching it and the forums turned up nothing. I looked at the api reference for show_item_metadata() and it looks like you can only restrict by metadata type. I'm trying to only have item text, contributor and date display. Is there a way to restrict the display on only these fields?

    Thanks,

    Dean

  2. As long as the other fields are empty you can hide them from displaying:

    <?php
    echo show_item_metadata(array('show_empty_elements' => false));
     ?>
  3. Alternatively, if you have data in other fields, but just want to show text, contributor and date, you can just remove the show_item_metadata() and call each field specifically.

    <?php echo item('Dublin Core', 'Title'); ?>
    <?php echo item('Item Type Metadata', 'Text'); ?>

    see: Functions/item

  4. That should do the trick.

    Thanks

Topic Closed

This topic has been closed to new replies.