I am trying to figure out how to change the following bit from a function to show the exhibit “cover” image instead of a random image from an item in the exhibit:
if ($recentExhibit) {
foreach( $recentExhibit as $index => $exhibit){
$html .= '<h3>' . exhibit_builder_link_to_exhibit($recentExhibit[$index]) . '</h3>';
if ($item = get_record('Item', array('sort_field' => 'random', 'exhibit' => $recentExhibit[$index]->id, 'hasImage' => true))) {
$html .= exhibit_builder_link_to_exhibit($recentExhibit[$index],
item_image('square_thumbnail', array(), 0, $item),
array('class' => 'image')
);
}
I know that this from the summary.php will do it, but I cant quite figure out how to adapt it
?php if ($exhibitImage = record_image($exhibit, ‘square_thumbnail’)): ?>
<?php echo exhibit_builder_link_to_exhibit($exhibit, $exhibitImage, array('class' => 'image')); ?>
<?php endif; ?>
Would love any help, thank you!