Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:howtos:displaying_a_custom_field
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
development:howtos:displaying_a_custom_field [2020/04/14 12:17] – demiankatz | development:howtos:displaying_a_custom_field [2020/09/22 13:27] (current) – demiankatz | ||
---|---|---|---|
Line 11: | Line 11: | ||
In the case of Solr, stored field data from the index is made available to the record driver through its fields property; in the case of MARC, convenience methods are provided for extracting data. For other data formats and sources, availability and format of internal data will vary according to the design of the [[development: | In the case of Solr, stored field data from the index is made available to the record driver through its fields property; in the case of MARC, convenience methods are provided for extracting data. For other data formats and sources, availability and format of internal data will vary according to the design of the [[development: | ||
- | For examples of display templates, see the [[https:// | + | For examples of display templates, see the [[https:// |
- | For examples of Solr-based retrievals, see the [[https:// | + | For examples of Solr-based retrievals, see the [[https:// |
===== Workflow for Adding a Field ===== | ===== Workflow for Adding a Field ===== | ||
Line 34: | Line 34: | ||
If you are displaying a field that is already defined within VuFind, you can skip this step. | If you are displaying a field that is already defined within VuFind, you can skip this step. | ||
- | If you are adding a totally new field, you will need to add an appropriate getter method to the record driver used to display your records. In the most common situation, this is going to be the [[https:// | + | If you are adding a totally new field, you will need to add an appropriate getter method to the record driver used to display your records. In the most common situation, this is going to be the [[https:// |
If you copy an existing method as a template for your new method, the most important detail to watch out for is the return value: be sure that you return a string when dealing with a single-valued Solr field and that you return an array when dealing with a multi-valued Solr field. This will make it easier for you to deal with data cleanly in your template. | If you copy an existing method as a template for your new method, the most important detail to watch out for is the return value: be sure that you return a string when dealing with a single-valued Solr field and that you return an array when dealing with a multi-valued Solr field. This will make it easier for you to deal with data cleanly in your template. | ||
Line 54: | Line 54: | ||
===== 4. Step-by-step examples ===== | ===== 4. Step-by-step examples ===== | ||
- | * [[development: | + | |
+ | | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
development/howtos/displaying_a_custom_field.1586866667.txt.gz · Last modified: 2020/04/14 12:17 by demiankatz