From 993a9593b66cce7d26f07a6bdace58b351e61c51 Mon Sep 17 00:00:00 2001 From: RickyLeeII Date: Mon, 13 May 2024 09:13:59 -0500 Subject: [PATCH] Add Uniform Title Field These changes add a field for "Uniform Title" to record pages when MARC field 130a is present. --- .../TAMU/View/Helper/Root/RecordDataFormatterFactory.php | 4 ++++ module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php | 8 ++++++++ themes/TAMU/theme.config.php | 3 ++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/module/TAMU/src/TAMU/View/Helper/Root/RecordDataFormatterFactory.php b/module/TAMU/src/TAMU/View/Helper/Root/RecordDataFormatterFactory.php index 4db70020844..18659a057af 100644 --- a/module/TAMU/src/TAMU/View/Helper/Root/RecordDataFormatterFactory.php +++ b/module/TAMU/src/TAMU/View/Helper/Root/RecordDataFormatterFactory.php @@ -68,6 +68,10 @@ public function getDefaultCoreSpecs() null, ['recordLink' => 'title'] ); + $spec->setLine( + 'Uniform Title', + 'getUniformTitle' + ); $spec->setMultiLine( 'Authors', 'getDeduplicatedAuthors', diff --git a/module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php b/module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php index 5a68db1393c..d7ad6fecd6c 100644 --- a/module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php +++ b/module/VuFind/src/VuFind/RecordDriver/DefaultRecord.php @@ -652,6 +652,14 @@ public function getLanguages() return (array)($this->fields['language'] ?? []); } + /** + * Get the uniform title from the 130a field + */ + public function getUniformTitle() + { + return $this->fields['uniform_title_str_mv'] ?? []; + } + /** * Get a raw, unnormalized LCCN. (See getLCCN for normalization). * diff --git a/themes/TAMU/theme.config.php b/themes/TAMU/theme.config.php index a1c271fb989..3cac34b8eff 100644 --- a/themes/TAMU/theme.config.php +++ b/themes/TAMU/theme.config.php @@ -4,7 +4,8 @@ 'favicon' => 'favicon.ico', 'helpers' => [ 'factories' => [ - 'TAMU\View\Helper\Root\Record' => 'VuFind\View\Helper\Root\RecordFactory' + 'TAMU\View\Helper\Root\Record' => 'VuFind\View\Helper\Root\RecordFactory', + 'VuFind\View\Helper\Root\RecordDataFormatter' => 'TAMU\View\Helper\Root\RecordDataFormatterFactory', ], 'aliases' => [ 'record' => 'TAMU\View\Helper\Root\Record'