Hello,
I'm developing a custom theme for our library's digital collections that I will soon be migrating from Greenstone. I want to be able to link to the full size image of an item on the items/show/* page:
<?php
head(array('title' => item('Dublin Core', 'Title'), 'bodyid'=>'items','bodyclass' => 'show'));
?>
<div id="item-show-left">
<h2><?php print item('Dublin Core', 'Title'); ?></h2>
<?php if(item_thumbnail()): ?>
"><?php print item_thumbnail(); ?>
<?php endif; ?>
<?php if (item_belongs_to_collection()): ?>
<div id="collection" class="element">
<h3><?php echo __('Collection'); ?></h3>
<div class="element-text"><p><?php echo link_to_collection_for_item(); ?></p></div>
</div>
<?php endif; ?>
<?php if (item_has_tags()): ?>
<div id="item-tags" class="element">
<h3><?php echo __('Tags'); ?></h3>
<div class="element-text"><?php echo item_tags_as_string(); ?></div>
</div>
<?php endif;?>
<div id="item-citation" class="element">
<h3><?php echo __('Citation'); ?></h3>
<div class="element-text"><?php echo item_citation(); ?></div>
</div>
<?php echo plugin_append_to_items_show(); ?>
<ul class="item-pagination navigation">
<li id="previous-item" class="previous"><?php echo link_to_previous_item(); ?>
<li id="next-item" class="next"><?php echo link_to_next_item(); ?>
</div>
<div id="item-show-right">
<?php echo custom_show_item_metadata(); ?>
</div>
<?php foot(); ?>
The item_file() call produces errors that I nabbed from my apache log:
[Thu Nov 15 11:41:15 2012] [error] [client 72.233.203.101] PHP Catchable fatal error: Argument 1 passed to Omeka_View_Helper_FileMetadata::fileMetadata() must be an instance of File, null given in /usr/local/www/omeka-1.5.3/application/helpers/FileMetadata.php on line 31, referer: http://testserver.lib.cwu.edu/omeka-1.5.3/
[Thu Nov 15 11:41:15 2012] [error] [client 72.233.203.101] PHP Fatal error: Undefined class constant 'PRIMARY_TYPE_NUM' in /usr/local/www/omeka-1.5.3/application/libraries/Zend/Session/SaveHandler/DbTable.php on line 522, referer: http://testserver.lib.cwu.edu/omeka-1.5.3/
I read the documentation and found similar posts in this forum, but can't get it to work.
I ended up achieving what I want with:
<?php
head(array('title' => item('Dublin Core', 'Title'), 'bodyid'=>'items','bodyclass' => 'show'));
preg_match('/src="(.*)" alt/', item_fullsize(), $matches);
$fullsize_uri = $matches[1];
?>
and:
<?php if(item_thumbnail()): ?>
"><?php print item_thumbnail(); ?>
<?php endif; ?>
That works, but I wonder why item_file() doesn't work?
Thanks! Overall the Omeka API is wonderful and very easy to use. Love it!
- Gavin