I'm getting Zend_Controller_Router_Exception - id is not specified on deco_exhibit_builder_exhibit_display_item() and Apache 500 Error on deco_exhibit_builder_display_exhibit_thumbnail_gallery(). Here's what I'm using, which works fine when placed directly into the plugin code:
/*
filtering ExhibitBuilder functions
new functions are identical to originals except where 'hacked' appears (in $title vars)
*/
add_filter('exhibit_builder_exhibit_display_item','deco_exhibit_builder_exhibit_display_item');
add_filter('exhibit_builder_display_exhibit_thumbnail_gallery','deco_exhibit_builder_display_exhibit_thumbnail_gallery');
function deco_exhibit_builder_display_exhibit_thumbnail_gallery($start, $end, $props = array(), $thumbnailType = 'square_thumbnail')
{
$html = '';
for ($i=(int)$start; $i <= (int)$end; $i++) {
if (exhibit_builder_use_exhibit_page_item($i)) {
$html .= "\n" . '<div class="exhibit-item">';
//hacked by @ebellempire
$title='<h3>'.item('Dublin Core', 'Title',array('snippet'=>80), $item).'</h3><p>'.item('Dublin Core', 'Description',array('snippet'=>240)).'<br/><a href="'.item('permalink').'"target="_blank">View Full Record</a></p>';
$thumbnail = item_image($thumbnailType, array('title'=>$title));
$html .= exhibit_builder_link_to_exhibit_item($thumbnail);
$html .= exhibit_builder_exhibit_display_caption($i);
$html .= '</div>' . "\n";
}
}
$html = apply_filters('exhibit_builder_display_exhibit_thumbnail_gallery', $html, $start, $end, $props, $thumbnailType);
return $html;
}
function deco_exhibit_builder_exhibit_display_item($displayFilesOptions = array(), $linkProperties = array(), $item = null)
{
if (!$item) {
$item = get_current_item();
}
// Always just display the first file (may change this in future).
$fileIndex = 0;
// Default link href points to the exhibit item page.
if (!isset($displayFilesOptions['linkAttributes']['href'])) {
$displayFilesOptions['linkAttributes']['href'] = exhibit_builder_exhibit_item_uri($item);
}
// Default alt text is the
if(!isset($displayFileOptions['imgAttributes']['alt'])) {
$displayFilesOptions['imgAttributes']['alt'] = item('Dublin Core', 'Title', array(), $item);
}
// Default title text is the
if(!isset($displayFileOptions['imgAttributes']['title'])) {
//hacked by @ebellempire
$title='<h3>'.item('Dublin Core', 'Title', array('snippet'=>80), $item).'</h3><p>'.item('Dublin Core', 'Description',array('snippet'=>240)).'<br/><a href="'.item('permalink').'"target="_blank">View Full Record</a></p>';
$displayFilesOptions['imgAttributes']['title'] = $title;
}
// Pass null as the 3rd arg so that it doesn't output the item-file div.
$fileWrapperClass = null;
$file = $item->Files[$fileIndex];
if ($file) {
$html = display_file($file, $displayFilesOptions, $fileWrapperClass);
} else {
$html = exhibit_builder_link_to_exhibit_item(null, $linkProperties, $item);
}
$html = apply_filters('exhibit_builder_exhibit_display_item', $html, $displayFilesOptions, $linkProperties, $item);
return $html;
}