Bug 31446 - Make it easier for libraries to hide lightbox_descriptions from OPAC lightbox gallery
Summary: Make it easier for libraries to hide lightbox_descriptions from OPAC lightbox...
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Alex Buckley
QA Contact: Testopia
URL:
Keywords:
Depends on: 28180
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-24 03:24 UTC by Alex Buckley
Modified: 2023-06-08 22:26 UTC (History)
0 users

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Optionally enable libraries to hide image descriptions from the lightbox galleries on OPAC item detail pages.
Version(s) released in:


Attachments
Bug 31446: Add new OpacLightboxImageDescriptions system preference (3.57 KB, patch)
2022-08-25 03:39 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 31446: Optionally hide the Opac lightbox image description (2.67 KB, patch)
2022-08-25 03:39 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 31446: Add IDs to parent elements of cover images (2.66 KB, patch)
2022-08-30 04:43 UTC, Alex Buckley
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buckley 2022-08-24 03:24:20 UTC
Since bug 28180 lightbox descriptions have displayed under cover images in the OPAC lightbox gallery. For example: 'Coce image from Amazon.com'.

These descriptions are useful if there are multiple cover images in the lightbox gallery.

But if there is only one image (for example the library only uses coce images, and not local cover images or other sources) then it would be useful to be able to optionally hide these descriptions.
Comment 1 Alex Buckley 2022-08-25 03:39:29 UTC
Created attachment 139738 [details] [review]
Bug 31446: Add new OpacLightboxImageDescriptions system preference

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Comment 2 Alex Buckley 2022-08-25 03:39:50 UTC
Created attachment 139739 [details] [review]
Bug 31446: Optionally hide the Opac lightbox image description

Test plan:
1. Apply patches, update database and restart services

2. Observe the new system preference OpacLightboxImageDescriptions is
set to 'Show'

3. Enable OpacAmazonCoverImages, GoogleJackets, Coce (CoceHost =
'https://coce.mykoha.co.nz', CoceProviders = select all, OpacCoce =
'Enable)

4. In the OPAC visit the item detail page of a record displaying multiple cover images in a gallery - (If such an item does not exist in your catalogue add the ISBN (020$a) of '9780080969572' to a biblio)

5. Observe descriptions are displayed under each image in the gallery
indicating where the items are from - e.g. 'Coce image from Amazon.com'

6. Change the OpacLightboxImageDescriptions syspref to "Don't show"

7. Confirm all the image descriptions are hidden in the OPAC item detail
page. However, the dots to skip between the different cover images
should still be visible.

8. Disable OpacAmazonCoverImages and Googlejackets sysprefs. Confirm
with only Coce images enabled the image descriptions are still hidden.

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Comment 3 Alex Buckley 2022-08-25 03:43:12 UTC
Ready for testing.
Comment 4 Alex Buckley 2022-08-30 04:43:01 UTC
Created attachment 139971 [details] [review]
Bug 31446: Add IDs to parent elements of cover images

Having ID attributes for all parent div tags of OPAC lightbox cover images would
make it easier for libraries to hide the lightbox descriptions hint text
displaying under cover images.

Libraries could simply add some JavaScript (in a format like below) to their OpacUserJS system preference for each image content source they use:
$("#coce-coverimg > .hint").hide();

Test plan:
1. Apply patch
2. Confirm all parent div elements of cover images now have an ID in
opac-detail.tt

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Comment 5 Alex Buckley 2022-08-30 05:47:56 UTC
I am working on a compromise patch for this bug report - as per https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31456#c6
Comment 6 Alex Buckley 2022-09-13 02:48:22 UTC
Just noting we have decided not to proceed with this fix. As Katrin pointed out in https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31456#c5 some content providers look to require text attribution in the Koha OPAC in order for their images to be used, so it is best for these attributions to be retained. 

If libraries do not use those content providers and want to hide where their cover images are coming from they can already do that using custom JavaScript in the  OpacUserJS syspref.