get_collection_for_item() doesn't appear to work.

Following the examples here:

Using the below snippet seems to return nothing at all:

$Collection = get_collection_for_item(); echo $Collection->description;

I have used link_to_collection_for_item() on the same page with no problems, but I want to access the collection description.

Any ideas?

The developer documentation on the codex is pretty much always for Omeka 1 only. We don't do a good enough job of noting that on every page, though.

Here the problem isn't with the function; it actually works exactly the same way now that it did then. The problem is that Collections don't have a simple "description" property anymore. You read the Dublin Core Description out of a collection by using the metadata() function, just like you would for an Item.

Thanks for the response.

Can you provide an example of using the metadata() function to get collection details from an item page (items/show.php)?

I'd like to get the Description field from Dublin Core.

This didn't work:

<?= metadata('collection', array('Dublin Core', 'Description')); ?>

$collection = get_collection_for_item();
echo metadata($collection, array('Dublin Core', 'Description'));