Bug 21330 - Add XSLT for authority detail page in OPAC
Summary: Add XSLT for authority detail page in OPAC
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Fridolin Somers
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 11083
Blocks:
  Show dependency treegraph
 
Reported: 2018-09-11 13:52 UTC by Marjorie Barry-Vila
Modified: 2023-11-09 20:06 UTC (History)
11 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose
Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/691
Text to go in the release notes:
This enhancement enables using custom XSLT stylesheets to display authority detail pages in the OPAC. Enter a path to the custom XSLT file in the new system preference AuthorityXSLTOpacDetailsDisplay (or enter an external URL). Use placeholders for multiple custom style sheets for different languages ({langcode}) and authority types ({authtypecode}).
Version(s) released in:
23.05.00,22.11.07


Attachments
Bug 21330: Add xslt for authority normal view in OPAC (14.31 KB, text/plain)
2022-02-07 11:29 UTC, Jérémy Breuillard
Details
Bug 21330: Add xslt for authority normal view in OPAC (14.26 KB, patch)
2022-02-07 13:04 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 21330: Add xslt for authority normal view in OPAC (14.31 KB, patch)
2022-02-07 14:29 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 21330: Add xslt for authority normal view in OPAC (14.31 KB, patch)
2022-02-07 14:54 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 21330: Add xslt for authority normal view in OPAC (20.32 KB, patch)
2022-02-08 09:59 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 21330: Add xslt for authority normal view in OPAC (20.27 KB, patch)
2022-08-02 13:54 UTC, Jérémy Breuillard
Details | Diff | Splinter Review
Bug 21330: Allow XSLT for authority detail view in OPAC (17.95 KB, patch)
2022-09-08 09:14 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 21330: Allow XSLT for authority detail view in OPAC (18.00 KB, patch)
2022-09-11 18:18 UTC, David Nind
Details | Diff | Splinter Review
Bug 21330: (follow-up) Update system preference description (1.88 KB, patch)
2022-09-11 18:18 UTC, David Nind
Details | Diff | Splinter Review
Bug 21330: Allow XSLT for authority detail view in OPAC (17.88 KB, patch)
2023-03-29 07:59 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 21330: (follow-up) Update system preference description (1.88 KB, patch)
2023-03-29 07:59 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 21330: (follow-up) Fix new preference text and place (4.37 KB, patch)
2023-03-29 07:59 UTC, Fridolin Somers
Details | Diff | Splinter Review
Bug 21330: Allow XSLT for authority detail view in OPAC (17.93 KB, patch)
2023-03-30 10:08 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 21330: (follow-up) Update system preference description (1.94 KB, patch)
2023-03-30 10:08 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 21330: (follow-up) Fix new preference text and place (4.43 KB, patch)
2023-03-30 10:09 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 21330: Allow XSLT for authority detail view in OPAC (17.93 KB, patch)
2023-04-09 13:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21330: (follow-up) Update system preference description (1.94 KB, patch)
2023-04-09 13:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21330: (follow-up) Fix new preference text and place (4.49 KB, patch)
2023-04-09 13:17 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 21330: (QA follow-up) Add 'empty' option to system preference description (2.00 KB, patch)
2023-04-09 13:17 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marjorie Barry-Vila 2018-09-11 13:52:15 UTC
Hi,
It would be fine to have a xslt stylesheet for authority normal view in OPAC (opac-authoritiesdetail.pl).

Regards,
Marjorie
Comment 1 Fridolin Somers 2021-12-18 09:30:08 UTC
Starts on Bug 11083
Comment 2 Jérémy Breuillard 2022-02-07 11:29:06 UTC Comment hidden (obsolete)
Comment 3 Jérémy Breuillard 2022-02-07 12:56:46 UTC Comment hidden (obsolete)
Comment 4 Jérémy Breuillard 2022-02-07 13:04:34 UTC Comment hidden (obsolete)
Comment 5 Jérémy Breuillard 2022-02-07 14:29:06 UTC Comment hidden (obsolete)
Comment 6 Jérémy Breuillard 2022-02-07 14:54:36 UTC Comment hidden (obsolete)
Comment 7 Jérémy Breuillard 2022-02-08 09:59:42 UTC Comment hidden (obsolete)
Comment 8 David Nind 2022-06-19 19:47:33 UTC
Patch no longer applies + whitespace errors 8-(..

git bz apply 21330

Bug 21330 - Add XSLT for authority normal view in OPAC

130276 - Bug 21330: Add xslt for authority normal view in OPAC

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 21330: Add xslt for authority normal view in OPAC
.git/rebase-apply/patch:76: trailing whitespace.
                        [% ELSE %]                      
.git/rebase-apply/patch:287: trailing whitespace.
        
.git/rebase-apply/patch:289: trailing whitespace.
        
.git/rebase-apply/patch:299: trailing whitespace.
        
warning: 4 lines add whitespace errors.
Using index info to reconstruct a base tree...
M	installer/data/mysql/mandatory/sysprefs.sql
M	koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref
M	koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt
.git/rebase-apply/patch:76: trailing whitespace.
                        [% ELSE %]                      
.git/rebase-apply/patch:287: trailing whitespace.
        
.git/rebase-apply/patch:289: trailing whitespace.
        
.git/rebase-apply/patch:299: trailing whitespace.
        
warning: 4 lines applied after fixing whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref
Auto-merging installer/data/mysql/mandatory/sysprefs.sql
CONFLICT (content): Merge conflict in installer/data/mysql/mandatory/sysprefs.sql
error: Failed to merge in the changes.
Patch failed at 0001 Bug 21330: Add xslt for authority normal view in OPAC
Comment 9 Jérémy Breuillard 2022-08-02 13:54:18 UTC
Created attachment 138515 [details] [review]
Bug 21330: Add xslt for authority normal view in OPAC

This patch provides a xslt stylesheet on authority normal view in OPAC. Have a look on opac-authoritiesdetail.pl

Test plan:
1)You need the file 'UNIMARCauthResults.xsl' -> get it in the patch from Bug 11083
2)For testing make sure to have at least one or more authorities defined

3)OPAC: Home > Authority search(Submit) > Authority search results
4)Click details on a result and notice the view
5)Apply patch
6)INTRA: Home > Administration > System preferences ->find "AuthorityXSLTOpacDetailsDisplay"
7)Write the path where your file is, ex: '/home/koha/src/UNIMARCauthResults.xsl'
8)Save changes
9)Repeat 3) and 4) and notice the display

This is a similar bug: Bug 30036
Comment 10 Jérémy Breuillard 2022-08-02 13:55:44 UTC
(In reply to David Nind from comment #8)

Trailing whitespaces are removed ! thanks :)
Comment 11 Julian Maurice 2022-09-08 09:14:27 UTC
Created attachment 140333 [details] [review]
Bug 21330: Allow XSLT for authority detail view in OPAC

This patch adds a syspref that allow to customize the authority detail
view in OPAC with XSLT.

Test plan:
1. Make sure to have at least one or more authorities
2. OPAC: Home > Authority search(Submit) > Authority search results
3. Click details on a result and notice the view
4. Apply patch
5. INTRA: Home > Administration > System preferences ->find
   "AuthorityXSLTOpacDetailsDisplay"
6. Write the path where your file is. You can try with the XSLT for
   biblio for instance:
   .../koha/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl
7. Save changes
8. Repeat 2-3 and notice the display
Comment 12 Julian Maurice 2022-09-08 09:16:39 UTC
Patch rebased on master
Comment 13 David Nind 2022-09-10 20:16:41 UTC
Apologies for taking so long to retest!

Just a question and a suggestion:

1. Is this for UNIMARC only, or should this work with UNIMARC and MARC21? The example XSLT file suggested only displays "Number of records displayed in: X" (where X = the number of records) for MARC21, but for a UNIMARC installation additional fields are displayed, which I presume is what is expected - that is, pointing to a file on the server will change the display of the details page.

2. Wording for the new system preference (happy to add my suggestions as a follow-up patch).

Display authority details in the OPAC using the XSLT stylesheet at: _________

Options:
* Enter a path to a custom XSLT file on the server.
* Enter a URL for an external stylesheet.

If you have multiple stylesheets for different:
* languages: use the placeholder {langcode} - this will be replaced with the current interface language
* authority types: use the placeholder {authtypecode} - this will be replaced with the current authority type code.
Comment 14 David Nind 2022-09-10 20:35:29 UTC
(In reply to David Nind from comment #13)
 
> 1. Is this for UNIMARC only, or should this work with UNIMARC and MARC21?..

Answering my own questions: applies to both UNIMARC and MARC21 instances.

> 2. Wording for the new system preference (happy to add my suggestions as a
> follow-up patch).

Will add a follow-up patch with my suggestions, then sign-off.

David
Comment 15 David Nind 2022-09-11 18:18:15 UTC
Created attachment 140408 [details] [review]
Bug 21330: Allow XSLT for authority detail view in OPAC

This patch adds a syspref that allow to customize the authority detail
view in OPAC with XSLT.

Test plan:
1. Make sure to have at least one or more authorities
2. OPAC: Home > Authority search(Submit) > Authority search results
3. Click details on a result and notice the view
4. Apply patch
5. INTRA: Home > Administration > System preferences ->find
   "AuthorityXSLTOpacDetailsDisplay"
6. Write the path where your file is. You can try with the XSLT for
   biblio for instance:
   .../koha/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl
7. Save changes
8. Repeat 2-3 and notice the display

Signed-off-by: David Nind <david@davidnind.com>
Comment 16 David Nind 2022-09-11 18:18:22 UTC
Created attachment 140409 [details] [review]
Bug 21330: (follow-up) Update system preference description

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 Katrin Fischer 2022-10-07 11:30:03 UTC
This one does not apply for me, I haven't seen that error before:

Applying: Bug 21330: Allow XSLT for authority detail view in OPAC
Using index info to reconstruct a base tree...
M	installer/data/mysql/mandatory/sysprefs.sql
Falling back to patching base and 3-way merge...
error: The following untracked working tree files would be overwritten by merge:
	installer/data/mysql/atomicupdate/bug-21330.pl
Please move or remove them before you merge.
Aborting
error: Failed to merge in the changes.
Comment 18 Katrin Fischer 2022-10-07 11:30:41 UTC
Julian, when you are back here: Can you please change 'intranet' to 'staff interface' in descriptions and move the pref to the OPAC tab?
Comment 19 Fridolin Somers 2023-03-29 07:59:28 UTC
Created attachment 148853 [details] [review]
Bug 21330: Allow XSLT for authority detail view in OPAC

This patch adds a syspref that allow to customize the authority detail
view in OPAC with XSLT.

Test plan:
1. Make sure to have at least one or more authorities
2. OPAC: Home > Authority search(Submit) > Authority search results
3. Click details on a result and notice the view
4. Apply patch
5. INTRA: Home > Administration > System preferences ->find
   "AuthorityXSLTOpacDetailsDisplay"
6. Write the path where your file is. You can try with the XSLT for
   biblio for instance:
   .../koha/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl
7. Save changes
8. Repeat 2-3 and notice the display

Signed-off-by: David Nind <david@davidnind.com>
Comment 20 Fridolin Somers 2023-03-29 07:59:31 UTC
Created attachment 148854 [details] [review]
Bug 21330: (follow-up) Update system preference description

Signed-off-by: David Nind <david@davidnind.com>
Comment 21 Fridolin Somers 2023-03-29 07:59:34 UTC
Created attachment 148855 [details] [review]
Bug 21330: (follow-up) Fix new preference text and place

Atomic updated fixed : intranet => OPAC
Changed to be more like the one adding AuthorityXSLTOpacResultsDisplay

New preference moved to opac.pref
Comment 22 Fridolin Somers 2023-03-29 08:03:38 UTC
Bug 30036 is enhancement so this one also.
New feature can sound scary ;)
Comment 23 Biblibre Sandboxes 2023-03-30 10:08:54 UTC
Created attachment 148969 [details] [review]
Bug 21330: Allow XSLT for authority detail view in OPAC

This patch adds a syspref that allow to customize the authority detail
view in OPAC with XSLT.

Test plan:
1. Make sure to have at least one or more authorities
2. OPAC: Home > Authority search(Submit) > Authority search results
3. Click details on a result and notice the view
4. Apply patch
5. INTRA: Home > Administration > System preferences ->find
   "AuthorityXSLTOpacDetailsDisplay"
6. Write the path where your file is. You can try with the XSLT for
   biblio for instance:
   .../koha/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl
7. Save changes
8. Repeat 2-3 and notice the display

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Thibault <thibault.keromnes@univ-paris8.fr>
Comment 24 Biblibre Sandboxes 2023-03-30 10:08:57 UTC
Created attachment 148970 [details] [review]
Bug 21330: (follow-up) Update system preference description

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Thibault <thibault.keromnes@univ-paris8.fr>
Comment 25 Biblibre Sandboxes 2023-03-30 10:09:00 UTC
Created attachment 148971 [details] [review]
Bug 21330: (follow-up) Fix new preference text and place

Atomic updated fixed : intranet => OPAC
Changed to be more like the one adding AuthorityXSLTOpacResultsDisplay

New preference moved to opac.pref

Signed-off-by: Thibault <thibault.keromnes@univ-paris8.fr>
Comment 26 Katrin Fischer 2023-04-09 13:17:42 UTC
Created attachment 149366 [details] [review]
Bug 21330: Allow XSLT for authority detail view in OPAC

This patch adds a syspref that allow to customize the authority detail
view in OPAC with XSLT.

Test plan:
1. Make sure to have at least one or more authorities
2. OPAC: Home > Authority search(Submit) > Authority search results
3. Click details on a result and notice the view
4. Apply patch
5. INTRA: Home > Administration > System preferences ->find
   "AuthorityXSLTOpacDetailsDisplay"
6. Write the path where your file is. You can try with the XSLT for
   biblio for instance:
   .../koha/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl
7. Save changes
8. Repeat 2-3 and notice the display

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Thibault <thibault.keromnes@univ-paris8.fr>
Comment 27 Katrin Fischer 2023-04-09 13:17:45 UTC
Created attachment 149367 [details] [review]
Bug 21330: (follow-up) Update system preference description

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Thibault <thibault.keromnes@univ-paris8.fr>
Comment 28 Katrin Fischer 2023-04-09 13:17:49 UTC
Created attachment 149368 [details] [review]
Bug 21330: (follow-up) Fix new preference text and place

Atomic updated fixed : intranet => OPAC
Changed to be more like the one adding AuthorityXSLTOpacResultsDisplay

New preference moved to opac.pref

Signed-off-by: Thibault <thibault.keromnes@univ-paris8.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 29 Katrin Fischer 2023-04-09 13:17:53 UTC
Created attachment 149369 [details] [review]
Bug 21330: (QA follow-up) Add 'empty' option to system preference description

This adds another list item to match the preference description
for the results page:

* Empty. No XSLT will be applied (default)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 30 Tomás Cohen Arazi 2023-05-15 20:56:11 UTC
No XSLT? <.<
Comment 31 Tomás Cohen Arazi 2023-05-15 21:16:49 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 32 Fridolin Somers 2023-05-16 07:14:09 UTC
If possible, we would like to see this backported to 22.11.x
Comment 33 Matt Blenkinsop 2023-06-02 16:15:09 UTC
Enhancement - not backporting to 22.11.x
Comment 34 Pedro Amorim 2023-06-07 09:27:26 UTC
We discussed as a team and agreed on pushing this.

Thanks everyone!
Pushed to 22.11.x for the next release.
Comment 35 Fridolin Somers 2023-06-09 06:55:23 UTC
Great :D thanks to all