How to change the display of the search

Hi!

I would need to edit the display of search results. Currently it shows two columns:

  • Type
  • Title

I would need it to show at least one more field (Identifier). Ideal would be, if would be possible to show other information also - creator, item type, etc.

I’ve managed to get it working for browsing items and on the items page. Just as an example - result on items browsing page looks something like this.

Code used for that: <h1>Arh# <?php echo metadata('item', array('Dublin Core', 'Identifier')) ?>: <?php echo metadata('item', array('Dublin Core', 'Title')); ?></h1>

Getting it working in search result doesn’t seem to be that staightforward though. :slight_smile: I’ve actually have a feeling that it might be coded somewhere in the applicationit self. Not so much in the theme. So if you find that this topic is in the wrong place then feel free to move it to more appropriate place.

Thank you…

The search page is different because it has to work for many different kinds of records at once (which is why by default its output is so generic).

Nevertheless, it does pretty much work the same way as any other page: its output is pretty much controlled within the theme. Like your other question, this can sometimes be obscured because most themes just use the default search page from the core. The solution is also the same: just copy the file from application/views/scripts/search/index.php to search/index.php in your theme and then edit it.

The only thing to watch out for: if you’re allowing searches for things other than Items, you’ll want to make sure the record you’re looking at is actually an Item and not a Collection, File, Exhibit, etc. before you try to print that metadata.

@jflatnes

Would you please be able to provide an example code? I would also like to have some metadata displayed in my search results.

Many thanks!

@jflatnes
Is there a way I can show all search results without pagination?
Thanks, Darp