display_records_types
Added in version 3.2.
Usage
Filters record types available to display_records and get_display_records.
Value
array$recordTypesArray of supported record types. The keys are record type names (
Item,Collection, etc.) and the values are arrays with two values:partialis the default partial to use to display one record of this type (often asingle.phppartial view), andaliasis the name of a variable that will be set on the partial and assigned the record object being displayed (this is in addition torecord, which is always set on the partial;aliasis typically useful when using existing partials which aren’t written to expect arecordvariable).
Arguments
This filter takes no additional arguments.
Examples
Support a plugin-added record type in display_records and get_display_records.
This sets a default partial used to display each record. When displaying the records,
that partial will be called and recieve variables record and myRecord, both set to
the currently-displaying record object.
class MyPlugin extends Omeka_Plugin_AbstractPlugin
{
protected $_filters = ['display_records_types'];
public filterDisplayRecordsTypes($recordTypes, $args)
{
$recordTypes['MyPlugin_MyRecord'] = ['partial' => 'my-plugin/my-record/single.php', 'alias' => 'myRecord'];
return $recordTypes;
}
}