Daniel-KM / Omeka-plugin-Reference

Plugin for Omeka that allows to serve alphabetized indexes of selected item types and elements of all items of an Omeka instance, or an expandable hierarchical list of all subjects. These pages can be displayed in any page via a helper or a shortcode.
8 stars 4 forks source link

Restrict reference to one collection? #5

Closed pprw closed 6 years ago

pprw commented 6 years ago

Is it possible to restrict results of reference to one collection?

For example, I would like to print the results for "/references/item-type-metadata-country" (so a list of countries) but only for the items appearing in collection A.

Daniel-KM commented 6 years ago

In fact, this is possible (and many more) in the version for Omeka S, but not for Omeka Classic.

So if you really need it, you can modify or extend the helper Reference_View_Helper_Reference for the method _getReferencesList() with this line:

            $select->where('items.collection_id = ' . (int) $collectionId);

The same for the method _count().

Pass the collectionId to the method too, or hard code it.