Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:howtos:displaying_a_custom_field:vufind6_example
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:vufind6_example [2020/04/14 12:43] – demiankatz | development:howtos:displaying_a_custom_field:vufind6_example [2023/11/09 21:32] (current) – demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Displaying a Custom | + | ====== Displaying a Custom |
// This example shows you how to set up a custom module, custom theme and custom record driver. It assumes that you have already added a custom field to your Solr index named RecID -- you can see more concrete examples of adding fields on the [[indexing: | // This example shows you how to set up a custom module, custom theme and custom record driver. It assumes that you have already added a custom field to your Solr index named RecID -- you can see more concrete examples of adding fields on the [[indexing: | ||
Line 64: | Line 64: | ||
* Edit $VUFIND_HOME/ | * Edit $VUFIND_HOME/ | ||
- | | + | For example, you could add this immediately preceding the div with a class of " |
- | <? $recordID = $this-> | + | |
- | < | + | <? $recordID = $this-> |
- | < | + | |
- | <? | + | |
- | | + | |
- | <? endif; ?> | + | |
+ | | ||
* Edit $VUFIND_LOCAL_DIR/ | * Edit $VUFIND_LOCAL_DIR/ | ||
Line 76: | Line 77: | ||
6. To add a new field to the core record view, you will need to add some custom configuration to the [[development: | 6. To add a new field to the core record view, you will need to add some custom configuration to the [[development: | ||
- | // Details coming soon... // | + | * First, create this directory: |
+ | |||
+ | mkdir -p $VUFIND_HOME/module/ModuleName/ | ||
+ | |||
+ | * Now, create a custom RecordDataFormatterFactory in your local code module; this is where configurations are set up. For example, you could edit $VUFIND_HOME/ | ||
+ | |||
+ | <? | ||
+ | |||
+ | | ||
+ | |||
+ | use VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder; | ||
+ | |||
+ | class RecordDataFormatterFactory extends \VuFind\View\Helper\Root\RecordDataFormatterFactory | ||
+ | { | ||
+ | | ||
+ | { | ||
+ | $spec = new SpecBuilder(parent:: | ||
+ | | ||
+ | | ||
+ | } | ||
+ | } | ||
+ | |||
+ | * Finally, edit $VUFIND_HOME/ | ||
+ | |||
+ | <? | ||
+ | | ||
+ | ' | ||
+ | ' | ||
+ | ]; | ||
+ | |||
+ | |||
+ | :!: In this example, the key line is $spec-> | ||
---- struct data ---- | ---- struct data ---- | ||
+ | properties.Page Owner : | ||
---- | ---- | ||
development/howtos/displaying_a_custom_field/vufind6_example.1586868229.txt.gz · Last modified: 2020/04/14 12:43 by demiankatz