OpacHiddenItems

From Koha Wiki
Jump to navigation Jump to search

The OpacHiddenItems system preference allows custom rules to be written that cause specific items to be hidden from the OPAC.

It allows YAML to be written defining the situations in which items are hidden, in the form:

field: [value1, value2]

where field is the name of the field in the item record. For example, itype or withdrawn.

If multiple fields are specified, then the item will be hidden if any of them match. If all items on a record are hidden, the record will be hidden in the OPAC as well.

A list of fields that an item has is available on the item schema page. Note that if you have an older version of Koha, it's possible some of these don't exist for you.

Examples

To hide all items with a withdrawn value of 1:

withdrawn: [1]

To hide all items with a lost value of 1 (Lost) or 4 (Missing). Check the Authorized value codes for lost at /cgi-bin/koha/admin/authorised_values.pl?searchfield=LOST:

Note - the system preference hidelostitems can be used if you wish to hide ALL lost items of any status.

itemlost: [1, 4]

To hide all items that are withdrawn, or have the item type (952$y) code HIDE or INVISIBLE or location (952$c) is PROC:

withdrawn: [1]
itype: [HIDE, INVISIBLE]
location: [PROC]