SolrSearch file display

In the SolrSearch plugin, the results page uses this code to display all of a record’s files in a gallery format:

<?php $item = get_db()->getTable($doc->model)->find($doc->modelid); echo item_image_gallery( array('wrapper' => array('class' => 'gallery')), 'square_thumbnail', false, $item); ?>

Is there a simple way to display only the record’s first file and link it to the record, rather than the file itself?

This should do what you want:

$item = get_db()->getTable($doc->model)->find($doc->modelid);
echo link_to($item, 'show', item_image('square_thumbnail', array(), 0, $item));

See the documentation for other helper functions that may be of use:

Perfect! Thank you, @kloor.

This topic was automatically closed after 250 days. New replies are no longer allowed.