Customize element texts for a particular element before validating and saving a record. This is helpful if you want to prepare form data for validation automatically, limiting the possibility of a validation error.
Filter Name
This filter's name is actually an array of strings. The first string must always be 'Save'
, but the last three can change depending on exactly what values you want to filter.
array('Save', $recordType, $elementSetName, $elementName)
-
$recordType
: The type of Omeka object to filter the metadata for. Most commonly, this will be'Item'
. -
$elementSetName
: The name of the element set containing the metadata field to be filtered. Possible values include'Dublin Core'
and'Item Type Metadata'
. -
$elementName
: The name of the specific element within the set to be filtered.
For example, the filter name for filtering the Dublin Core Title element for Items would be:
array('Save', 'Item', 'Dublin Core', 'Title')
Parameters
- string
$text
{{#if - | (optional)}}
- The original text for the element (the value being filtered).
- {{#if: | Default:
{{{default}}}
}} - mixed
$record
{{#if - | (optional)}}
- The record that this text applies to. The type will be the same as the filter's
$recordType
. - {{#if: | Default:
{{{default}}}
}} - Element
$element
{{#if - | (optional)}}
- The Element record for this text.
- {{#if: | Default:
{{{default}}}
}}
Return
Implementations of this filter must return a string containing the modified element text.