Bug 27613 - Pipe separated contents are hard to customize (OPAC)
Summary: Pipe separated contents are hard to customize (OPAC)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
: 29176 (view as bug list)
Depends on:
Blocks: 30148 33830 27627
  Show dependency treegraph
 
Reported: 2021-02-04 00:25 UTC by Lucas Gass
Modified: 2023-05-25 06:51 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00


Attachments
Bug 27613: Change pipe seperated online resource links to psuedo elements (11.95 KB, patch)
2021-02-04 00:34 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 27613: Change pipe seperated online resource links to psuedo elements (12.00 KB, patch)
2021-02-04 15:32 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27613: (follow-up) Modify additional repeating entries for consistency (74.66 KB, patch)
2021-10-05 15:22 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27613: Change pipe seperated online resource links to psuedo elements (11.92 KB, patch)
2021-11-08 15:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27613: (follow-up) Modify additional repeating entries for consistency (74.66 KB, patch)
2021-11-08 15:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27613: Change pipe seperated online resource links to psuedo elements (11.99 KB, patch)
2021-11-11 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27613: (follow-up) Modify additional repeating entries for consistency (74.72 KB, patch)
2021-11-11 15:07 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 27613: (follow-up) add authors and contributors (4.09 KB, patch)
2021-12-12 23:28 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 27613: Change pipe seperated online resource links to psuedo elements (11.99 KB, patch)
2022-01-06 11:51 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27613: (follow-up) Modify additional repeating entries for consistency (74.72 KB, patch)
2022-01-06 11:51 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27613: (follow-up) add authors and contributors (4.14 KB, patch)
2022-01-06 11:51 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27613: Change pipe seperated online resource links to psuedo elements (11.99 KB, patch)
2022-02-21 20:57 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27613: (follow-up) Modify additional repeating entries for consistency (74.72 KB, patch)
2022-02-21 20:57 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27613: (follow-up) add authors and contributors (4.14 KB, patch)
2022-02-21 20:58 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27613: Change pipe seperated online resource links to psuedo elements (12.04 KB, patch)
2022-02-21 21:27 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27613: (follow-up) Modify additional repeating entries for consistency (74.78 KB, patch)
2022-02-21 21:27 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27613: (follow-up) add authors and contributors (4.19 KB, patch)
2022-02-21 21:27 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 Lucas Gass 2021-02-04 00:25:47 UTC
In the opac results and detail page multiple 856 online resource links are seperated by a '|', which is added via XSLT. Since they are not wrapped inside any HTML element it can be hard to customize with CSS/JS. 

If they were instead psuedo elements it would be easier to remove them or style them differently.
Comment 1 Lucas Gass 2021-02-04 00:34:39 UTC Comment hidden (obsolete)
Comment 2 Owen Leonard 2021-02-04 15:32:23 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2021-02-06 22:10:55 UTC Comment hidden (obsolete)
Comment 4 Katrin Fischer 2021-02-06 22:14:48 UTC
I am not completely sure about this one.

The existing pattern at the moment would be to use <span class="separator"> | </span>.

What is the advantage of the pseudo element? That it can be overwritten using CSS instead of jQuery? 

I tried to remove the 3rd link out of 4 by using: $("a:contains('Table')").remove(); 

Sample data: Philippics. I-II / Cicero ; edited by John T. Ramsey.

In this case I end up with || and have no idea how to fix that. Previously I would just hide the preceeding one with jQuery as well and that would solve he issue. I am not sure if and how I could do that now.

We often get requests for hiding some or highlighting other URLs, so that's a common use case for me. Remember: Our records are created in a union catalog, there are often tons of links, but changing the records locally is not an option as the union catalog is the primary database.

I am failing this, because I think if we change it on the detail page, we should really change it in the results list too.

And personally I'd really like to know if you can still hide elements in a nice way somehow!
Comment 5 Lucas Gass 2021-02-18 16:34:11 UTC
Cait,

1. This patch does change both the OPAC detail and the OPAC results page. 

2. I think we can still easily, even more easily, remove links with jQuery. In your example I would use this:

$('a[href="http://www.loc.gov/catdir/toc/cam041/2003273871.html"] ').parent().hide(); // This works for hiding it on both the results and detials.


3. I think to semantically describe the online_resource section as a list of links is good.
Comment 6 Katrin Fischer 2021-02-19 12:47:12 UTC
Hi Lucas, I will test it, but meant all the other repeating fields using the existing pattern. I think having 2 ways do to things is not necessarily good, better to agree to switch or keep.
Comment 7 Owen Leonard 2021-10-05 15:22:24 UTC Comment hidden (obsolete)
Comment 8 Owen Leonard 2021-10-05 15:24:20 UTC
*** Bug 29176 has been marked as a duplicate of this bug. ***
Comment 9 Owen Leonard 2021-11-08 15:48:44 UTC Comment hidden (obsolete)
Comment 10 Owen Leonard 2021-11-08 15:48:48 UTC Comment hidden (obsolete)
Comment 11 Martin Renvoize 2021-11-11 15:07:03 UTC
Created attachment 127542 [details] [review]
Bug 27613: Change pipe seperated online resource links to psuedo elements

To test:
1. Have a record with many 856 links
2. Look at the links on both the results and detail pages.
3. Look at the '|' and notice it is outside any HTML element, making it
   hard to remove.
4. Apply the patch and regenerate the CSS
5. Look at both the pages again and notice that the '|' is now a psuedo
   element.
6. It should look identical to the way it did without the patch
7. Switch the system pref OPACURLOpenInNewWindow to 'do' and make sure
   the the links look and function right still.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2021-11-11 15:07:07 UTC
Created attachment 127543 [details] [review]
Bug 27613: (follow-up) Modify additional repeating entries for consistency

This patch makes further changes to the detail and results XSLT in the
OPAC so that previously pipe-separated fields are styled with CSS. The
following tags are modified on the detail page:

020 ISBN
022 ISSN
050 LOC classification
060 NLM classification
082 DDC classification
084 Other classification
130/240/730 Uniform titles
246 Other title
336 Content type
337 Media type
338 Carrier type
385 Audience
508 Production credits
583 Action note
586 Awards
655 Genre/Form
700/710/711 Contained works
700/710/711 Related works
770 Supplement
772 Supplement to
856 Online resources

These are modified on the results page:

028 Publisher number
246 Other title

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

In order to better see the effect of the CSS change you can add
something ike this to your OPACUserCSS system preference:

    .resource_list li::after {
        content: "♦";
    }

View catalog search results and detail pages for records which contain
repeated entries from the tag list above. The entries should be
separated by "|" without customization, or the symbol from your
OPACUserCSS if you specified one.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2021-11-11 15:08:03 UTC
Looks great to me, signing off.
Comment 14 Katrin Fischer 2021-11-19 15:03:08 UTC
Ok, I came around to the change :)

Only one question: could we throw in the contributurs/authors list to make this more complete of a change?

There might be some more in the Utils file that need attention.
Comment 15 Lucas Gass 2021-12-12 23:28:51 UTC
Created attachment 128425 [details] [review]
Bug 27613: (follow-up) add authors and contributors
Comment 16 Owen Leonard 2022-01-06 11:51:24 UTC
Created attachment 129051 [details] [review]
Bug 27613: Change pipe seperated online resource links to psuedo elements

To test:
1. Have a record with many 856 links
2. Look at the links on both the results and detail pages.
3. Look at the '|' and notice it is outside any HTML element, making it
   hard to remove.
4. Apply the patch and regenerate the CSS
5. Look at both the pages again and notice that the '|' is now a psuedo
   element.
6. It should look identical to the way it did without the patch
7. Switch the system pref OPACURLOpenInNewWindow to 'do' and make sure
   the the links look and function right still.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 17 Owen Leonard 2022-01-06 11:51:28 UTC
Created attachment 129052 [details] [review]
Bug 27613: (follow-up) Modify additional repeating entries for consistency

This patch makes further changes to the detail and results XSLT in the
OPAC so that previously pipe-separated fields are styled with CSS. The
following tags are modified on the detail page:

020 ISBN
022 ISSN
050 LOC classification
060 NLM classification
082 DDC classification
084 Other classification
130/240/730 Uniform titles
246 Other title
336 Content type
337 Media type
338 Carrier type
385 Audience
508 Production credits
583 Action note
586 Awards
655 Genre/Form
700/710/711 Contained works
700/710/711 Related works
770 Supplement
772 Supplement to
856 Online resources

These are modified on the results page:

028 Publisher number
246 Other title

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

In order to better see the effect of the CSS change you can add
something ike this to your OPACUserCSS system preference:

    .resource_list li::after {
        content: "♦";
    }

View catalog search results and detail pages for records which contain
repeated entries from the tag list above. The entries should be
separated by "|" without customization, or the symbol from your
OPACUserCSS if you specified one.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 18 Owen Leonard 2022-01-06 11:51:32 UTC
Created attachment 129053 [details] [review]
Bug 27613: (follow-up) add authors and contributors

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 19 Katrin Fischer 2022-02-21 20:57:53 UTC
Created attachment 130973 [details] [review]
Bug 27613: Change pipe seperated online resource links to psuedo elements

To test:
1. Have a record with many 856 links
2. Look at the links on both the results and detail pages.
3. Look at the '|' and notice it is outside any HTML element, making it
   hard to remove.
4. Apply the patch and regenerate the CSS
5. Look at both the pages again and notice that the '|' is now a psuedo
   element.
6. It should look identical to the way it did without the patch
7. Switch the system pref OPACURLOpenInNewWindow to 'do' and make sure
   the the links look and function right still.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 20 Katrin Fischer 2022-02-21 20:57:58 UTC
Created attachment 130974 [details] [review]
Bug 27613: (follow-up) Modify additional repeating entries for consistency

This patch makes further changes to the detail and results XSLT in the
OPAC so that previously pipe-separated fields are styled with CSS. The
following tags are modified on the detail page:

020 ISBN
022 ISSN
050 LOC classification
060 NLM classification
082 DDC classification
084 Other classification
130/240/730 Uniform titles
246 Other title
336 Content type
337 Media type
338 Carrier type
385 Audience
508 Production credits
583 Action note
586 Awards
655 Genre/Form
700/710/711 Contained works
700/710/711 Related works
770 Supplement
772 Supplement to
856 Online resources

These are modified on the results page:

028 Publisher number
246 Other title

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

In order to better see the effect of the CSS change you can add
something ike this to your OPACUserCSS system preference:

    .resource_list li::after {
        content: "♦";
    }

View catalog search results and detail pages for records which contain
repeated entries from the tag list above. The entries should be
separated by "|" without customization, or the symbol from your
OPACUserCSS if you specified one.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 21 Katrin Fischer 2022-02-21 20:58:03 UTC
Created attachment 130975 [details] [review]
Bug 27613: (follow-up) add authors and contributors

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 22 Katrin Fischer 2022-02-21 21:26:33 UTC
Forgot my sign-off lines!
Comment 23 Katrin Fischer 2022-02-21 21:27:05 UTC
Created attachment 130977 [details] [review]
Bug 27613: Change pipe seperated online resource links to psuedo elements

To test:
1. Have a record with many 856 links
2. Look at the links on both the results and detail pages.
3. Look at the '|' and notice it is outside any HTML element, making it
   hard to remove.
4. Apply the patch and regenerate the CSS
5. Look at both the pages again and notice that the '|' is now a psuedo
   element.
6. It should look identical to the way it did without the patch
7. Switch the system pref OPACURLOpenInNewWindow to 'do' and make sure
   the the links look and function right still.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 24 Katrin Fischer 2022-02-21 21:27:10 UTC
Created attachment 130978 [details] [review]
Bug 27613: (follow-up) Modify additional repeating entries for consistency

This patch makes further changes to the detail and results XSLT in the
OPAC so that previously pipe-separated fields are styled with CSS. The
following tags are modified on the detail page:

020 ISBN
022 ISSN
050 LOC classification
060 NLM classification
082 DDC classification
084 Other classification
130/240/730 Uniform titles
246 Other title
336 Content type
337 Media type
338 Carrier type
385 Audience
508 Production credits
583 Action note
586 Awards
655 Genre/Form
700/710/711 Contained works
700/710/711 Related works
770 Supplement
772 Supplement to
856 Online resources

These are modified on the results page:

028 Publisher number
246 Other title

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

In order to better see the effect of the CSS change you can add
something ike this to your OPACUserCSS system preference:

    .resource_list li::after {
        content: "♦";
    }

View catalog search results and detail pages for records which contain
repeated entries from the tag list above. The entries should be
separated by "|" without customization, or the symbol from your
OPACUserCSS if you specified one.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 25 Katrin Fischer 2022-02-21 21:27:14 UTC
Created attachment 130979 [details] [review]
Bug 27613: (follow-up) add authors and contributors

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 26 Fridolin Somers 2022-02-25 00:36:14 UTC
Pushed to master for 22.05, thanks to everybody involved 🦄
Comment 27 Katrin Fischer 2022-02-27 00:08:27 UTC
(In reply to Fridolin Somers from comment #26)
> Pushed to master for 22.05, thanks to everybody involved 🦄

I found some display issues that might be related to this bug:

Example in ktd sample database:
http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=70

The label by is 'below' the content that is 'above' it.

Could some CSS be missing? I think it looked ok in testing.
Comment 28 Fridolin Somers 2023-05-25 06:51:48 UTC
(In reply to Katrin Fischer from comment #27)
> I found some display issues that might be related to this bug:
> 
> Example in ktd sample database:
> http://localhost:8080/cgi-bin/koha/opac-detail.pl?biblionumber=70
> 
> The label by is 'below' the content that is 'above' it.
> 
> Could some CSS be missing? I think it looked ok in testing.

I confirm this is not normal.
I've opened Bug 33830.