Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:architecture:record_data_formatter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
development:architecture:record_data_formatter [2017/07/20 12:49] – [Specification Array] demiankatz | development:architecture:record_data_formatter [2018/11/06 18:06] – [The Specification Builder] demiankatz | ||
---|---|---|---|
Line 12: | Line 12: | ||
* A [[development: | * A [[development: | ||
- | As output, getData() returns an associative array of field name < | + | As output, getData() returns |
+ | |||
+ | Field names are raw and should be translated/ | ||
Additionally, | Additionally, | ||
Line 26: | Line 28: | ||
| helperMethod | optional | The Record view helper method to use for output rendering, when renderType = RecordHelper. | | | helperMethod | optional | The Record view helper method to use for output rendering, when renderType = RecordHelper. | | ||
| pos | optional | An integer used for sorting the fields to determine the final display order. | | | pos | optional | An integer used for sorting the fields to determine the final display order. | | ||
- | | renderType | optional (default = Simple) | The method used to render output from the input provided by dataMethod. Legal values: RecordDriverTemplate (render a template associated with the record driver, as specified by the ' | + | | renderType | optional (default = Simple) | The method used to render output from the input provided by dataMethod. Legal values: |
- | | labelFunction | optional | May be set to a callback function which will receive the raw field data as input and produce a custom output label (overriding the key of the spec array) as output. | | + | | labelFunction | optional | May be set to a callback function which will receive the raw field data as input and produce a custom output label (overriding the key of the spec array) as output. Starting with VuFind 5.0, the callback function also receives the record driver object as a second parameter. | |
+ | | multiFunction | optional | The callback required when renderType = Multi. Accepts three parameters: 1.) raw input data, 2.) the options array from the spec, 3.) the record driver object. Outputs an array of associative arrays with the following keys: **label**: Label to display; **values**: Values to render; **options**: | ||
+ | | multiRenderType | optional | The default type of rendering to apply to each of the sets of values returned by the multiFunction (optional, defaults to Simple, may be overridden by options specified by your multiFunction). | | ||
| prefix | optional | HTML to prepend to the output generated by the view helper. Applies only when RenderType = Simple. | | | prefix | optional | HTML to prepend to the output generated by the view helper. Applies only when RenderType = Simple. | | ||
| recordLink | optional | The type of link (from the Record view helper' | | recordLink | optional | The type of link (from the Record view helper' | ||
Line 34: | Line 38: | ||
| template | optional | The name of the template to render, when renderType = RecordDriverTemplate | | | template | optional | The name of the template to render, when renderType = RecordDriverTemplate | | ||
| translate | optional (default = false) | Should we run raw field data through the translator? Applies only when RenderType = Simple. | | | translate | optional (default = false) | Should we run raw field data through the translator? Applies only when RenderType = Simple. | | ||
- | | translationTextDomain | optional (default = '' | + | | translationTextDomain | optional (default = '' |
| useCache | optional (default = false) | Should we cache the raw field data in the view helper to avoid duplicate calls? | | | useCache | optional (default = false) | Should we cache the raw field data in the view helper to avoid duplicate calls? | | ||
Line 44: | Line 48: | ||
* setLine($key, | * setLine($key, | ||
+ | * setMultiLine($key, | ||
* setTemplateLine($key, | * setTemplateLine($key, | ||
* reorderKeys($orderedKeys, | * reorderKeys($orderedKeys, |
development/architecture/record_data_formatter.txt · Last modified: 2023/12/11 16:11 by dltj