Filters/Element Form Input Filter

Customize the form input for a particular element. This only applies to forms generated by the display_form_input_for_element() helper function.

Filter Name

This filter's name is actually an array of strings. The first string must always be 'Form', but the last three can change depending on exactly what values you want to filter.

array('Form', $recordType, $elementSetName, $elementName)
  • $recordType: The type of Omeka object to filter the input form 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 form for the Dublin Core Title element for Items would be:

array('Form', 'Item', 'Dublin Core', 'Title')

Parameters

string $html {{#if
| (optional)}}
An empty string.
{{#if: | Default: {{{default}}}}}
string $inputNameStem {{#if
| (optional)}}
The stem of the input name, e.g. 'Elements[63][0]'. Remember to append '[text]' or '[html]' to the stem to complete it.
{{#if: | Default: {{{default}}}}}
string $value {{#if
| (optional)}}
The initial value for the input.
{{#if: | Default: {{{default}}}}}
array $options {{#if
| (optional)}}
Additional options and attributes for the form input.
{{#if: | Default: {{{default}}}}}
Omeka_Record $record {{#if
| (optional)}}
The record that the element text applies to.
{{#if: | Default: {{{default}}}}}
Element $element {{#if
| (optional)}}
The Element object for the filtered element.
{{#if: | Default: {{{default}}}}}

Return

Implementations of this filter must return a string containing the HTML for the customized element form. If an empty string is returned, the default element form will be used.