In the docs it reads
Omeka 2.2 allows records other than Items to show thumbnails and other
functionality that depends on File records by choosing a “representative”
file.
But how is the representative file determined? It seems like it just pulls the FILE from the lowest-id’ed item that belongs to that collection?
Is it possible to manually associate or create a file to be used as the “representative” of a collection?
-JK
You can create a custom function like the one below to manually associate a collection with an image from your theme…
function get_collection_image($id){
$collectionImages=array(
1=>WEB_ROOT.'/themes/YOURTHEME/images/1.png', // collection 1
2=>WEB_ROOT.'/themes/YOURTHEME/images/2.png', // collection 2
);
if(isset($collectionImages[$id])){
return $collectionImages[$id];
}else{
$fallbackImage=WEB_ROOT.'/themes/YOURTHEME/images/fallback.png'; //fallback
return $fallbackImage;
}
}
get_collection_image(metadata('collection', 'id'))
will return the source URL for an image file if one exists (i.e. collection #1 or #2), otherwise it will use the fallback image (any other collection).