Omeka icon indicating copy to clipboard operation
Omeka copied to clipboard

Sort Browse Items by Item Type

Open jcmundy opened this issue 6 years ago • 2 comments

I can get the browse items page to sort by item_type_id, but not item_type_name. The Item Types are not alphabetical, so item_type_id feels a bit random. Am I doing something wrong? Is there a particularly different way to access item_type_name for the sortLinks? Thank you.

jcmundy avatar Feb 28 '18 17:02 jcmundy

I'm still having this issue. I appreciate any advice.

jcmundy avatar Mar 28 '18 16:03 jcmundy

Yeah... this is basically why there's no button to hit on the admin headers to sort by Type either (also because we show both item type and Dublin Core Type there).

You need to do a join to get the item type name for a given ID and do the sorting against the names. There's nothing built in to do this but it could be done either with a plugin using the item_browse_sql hook or by editing the Table/Item model class's applySorting method.

zerocrates avatar Mar 28 '18 23:03 zerocrates