Skip to content

Instantly share code, notes, and snippets.

@jeremyboggs
Created August 14, 2012 23:37
Show Gist options
  • Save jeremyboggs/3353902 to your computer and use it in GitHub Desktop.
Save jeremyboggs/3353902 to your computer and use it in GitHub Desktop.
Replace the title of all items in Omeka's Exhibit Builder plugin with a different field.
<?php
/**
* Replace the title of all items in Exhibit Builder with a different field.
*
* Add this to a new plugin, change the field to whatever field you want, and
* activate the plugin.
*/
function exhibit_item_title_switch($title, $item) {
$request = Zend_Controller_Front::getInstance()->getRequest();
if ($request->getModuleName() == 'exhibit-builder') {
// Replace title field here.
$title = item('Dublin Core', 'Description', null, $item);
}
return $title;
}
add_filter(array('Display', 'Item', 'Dublin Core', 'Title'), exhibit_item_title_switch);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment