https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42345 Bug ID: 42345 Summary: Add Koha::Template::Plugin::Marc for raw MARC field access in Template Toolkit Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Cataloging Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: m.de.rooy@rijksmuseum.nl Currently, accessing raw MARC field/subfield data from within Template Toolkit templates requires going through the Koha::Biblio object's accessors, which only expose a curated subset of fields. For arbitrary MARC fields and subfields, sites have to fall back to XSLT stylesheets - which are notoriously difficult for librarians and end users to read, write, or modify. Proposal: Add a new TT plugin Koha::Template::Plugin::Marc that exposes MARC field and subfield access in a librarian-friendly way: [% USE Marc %] [% Marc.field(biblio, '245', 'a') %] [% Marc.subfields(biblio, '650') %] [% Marc.fields(biblio, '650') %] Possible API surface: - field(biblio, tag, subfield) - first matching subfield value - fields(biblio, tag, subfield) - all matching subfield values - subfields(biblio, tag) - all subfields of a field - has_field(biblio, tag) - boolean This would unlock Template Toolkit as a viable replacement for many of the XSLT customisations sites currently maintain (search results, detail views, OPAC display, etc.) and would be immediately useful to features like bug 41902 (DuplicateCheckAdditionalInfo) where the syspref accepts TT and a Koha::Biblio object. Precedent: Koha::Template::Plugin::Remove_MARC_punctuation already shows the project is comfortable with MARC-aware TT plugins - this generalises that pattern. Identified during work on bug 41902. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.