get_collection_for_item
— Get the Collection object for the current item.
Summary
- get_collection_for_item($item = null)
Get the Collection object for the current item.
- Parameters:
$item (
Item|null
) – Check for this specific item record (current item if null).
- Returns:
Collection
Usage
Examples
Print the title and description of the Collection the current Item belongs to (if any):
<?php
$collection = get_collection_for_item();
if ($collection):
?>
<h3><?php echo metadata($collection, array('Dublin Core', 'Title')); ?></h3>
<p><?php echo metadata($collection, array('Dublin Core', 'Description')); ?></p>
<?php endif; ?>