Display thumbnails under Featured Collection

I am using Omeka 2.0 and the Berlin (2.1.3) theme to develop a digital collection for a local library. I am having trouble getting a featured implemented that I think would make the page look a lot more interesting.

Under the Featured Collection on the homepage, I would like it to pull 3 or 4 thumbnail images and display them below in a block.

I was using the 'deco' theme before I switched Berlin and it had this feature out-of-the-box, but I wasn't able to successfully take the code from deco and use it in Berlin.

I will post the code from deco that does this below in case it will help.

Can anyone provide the code necessary to do this in Berlin?


I've tried placing this in a custom.php file under Berlin:

 * This function returns the random featured collection settings for the theme.
//this is the function that toggles the Collection Thumbs
function deco_collection_thumbs_number($num=4){
		$collection_thumbs_setting=get_theme_option('Collection Thumbs');
		if ($collection_thumbs_setting == 'yes'){

			echo '<div id="index-collection-img">';

	        set_loop_records('items', $items);
	        if (has_loop_records('items')){
		        foreach (loop('items') as $item){
		        	echo link_to_item(item_image('square_thumbnail'));


function deco_random_featured_collection(){
	        if ($collection){
	        set_current_record('collection', $collection);
					echo '<h2>Featured Collection</h2>';
					echo '<h3>'.link_to_collection().'</h3>';
					echo '<p>'.metadata($collection,array("Dublin Core","Description"),array('snippet'=>750)).'</p>';
					echo deco_collection_thumbs_number();
        		echo'<p><em>There are no featured collections right now. You should turn off "Display Featured Collections" in the theme settings until you have some.</em></p>';

//this is the function that is actually used on homepage...
function deco_display_random_featured_collection(){
		$random_featured_collection_setting=get_theme_option('Random Featured Collection') ? get_theme_option('Random Featured Collection') : 'yes';
		if ($random_featured_collection_setting == 'yes')return deco_random_featured_collection();

and using this to call it:

<?php echo deco_display_random_featured_collection();?>

It didn't work :(

On the admin backend page under 'deco' Themes>Customize Theme, there is a checkbox option to "Display 4 thumbnail images (if they exist) for Featured Collections on homepage?"

I can't find where this is called anywhere so that I could try moving the code from deco to Berlin. I have the code from deco successfully pulling random collections, but am still not able to display the thumbnails underneath.

It might be worth upgrading to the latest Omeka. It includes a new function, record_image(), that addresses the desire for this feature.

For Collection records, it will return the first featured image it finds. If that doesn't quite work, you might be able to take the code on the Collection model that gets the file as an example to work from and modify in your own function.

As soon as the Dropbox plugin gets ported over for 2.2, I'd upgrade in a heartbeat. We have way to many items we are preparing to upload them individually.

The latest Dropbox should work with 2.2. It just needs at least 2.0.

Are you hitting problems with it?

In my limited experience with Omeka, unless the Omeka Target was the exact version, I haven't been able to get any of the plugins to function correctly. The same goes with plugins. I may make a site backup and try to upgrade now and see what happens. It's not a live site at the moment.

I'm not very strong at programming, and I have upgraded to 2.2.2 and have all plugins working again.

Could you please give me an example of how the record_image function would be used to simply display the 'full-size' image in the collections/browse.php file?


This code did the trick

<?php if ($collectionImage = record_image('collection', 'fullsize')): ?>
        <?php echo link_to_collection($collectionImage, array('class' => 'image')); ?>
    <?php endif; ?>