I have created a digital archive for an journal, comprising a dozen collections, each of which contains anything up to 18 items (documents)
When I do a search it returns all matching items, but in such as way that each has to be examined to find out where it came from. Is there a way to configure the Search to return the enclosing Collection as well as the Item?
You should be able to add that information to the search results view in your theme (search/index.php if you're using the site-wide search; you'll probably have to copy the view out of application/views/scripts into your theme and edit it there).
You can print the collection name (and link to the collection) with link_to_collection_for_item.
Thank you. I understand about putting the search/index.php into my theme - and have already modified it to show a proper thumbnail rather than the square one (And on that subject, why oh why do we have to do that? Square thumbnails are useless!)
However, I cannot see how to use the link_to_collection_for_item. How do I use it when there's no parameter to pass that indicates what the item is?
OK, I've sussed it. Just running the method will automagically know the current item :) Anyway, it works. Thank you
An update - extention of the request: how do I get just the collection, without a link to it? In my system there's a simple page for each collection as I couldn't get the desired layout in any other way. I can get the simple page slug from the collection id and want to link to that.
You can get the collection object itself by calling
$record->getCollection() (assuming that $record is an Item, of course).