[OPEN-ILS-GENERAL] Icons for online resources

Jason Boyer jboyer at equinoxinitiative.org
Mon Feb 17 09:25:49 EST 2020


I was working with some CSS for a personal project this weekend and I thought it was interesting enough to share. Currently the online resources links on record detail pages are unadorned and generally speaking very repetitive (Click here to …). What I was trying to do was replace the links with just an icon with a recognizable logo for the website and came up with this CSS to use at the bottom of /openils/var/templates/opac/css/style.css.tt2:


/* Full replacement */
a.uri_link[href*=“example.com <http://example.com/>”] {
  content: url(/images/link_icons/image.png);
}

/* Insert to the left of the link */
a.uri_link[href*=“example.com <http://example.com/>”] > *::before {
  content: url(/images/link_icons/image.png);
}

Then put your custom images under /openils/var/web/images/link_icons/ or anywhere you want and adjust the url()’s. (Mind the quotes, I apologize if they’ve been made “smart” by my mail client)

With some additional customization you can add these to the search results but that’s a bit more involved and really requires you to also use a blank image for any domain you don’t want to make an icon for so your results aren’t needlessly cluttered.

Also of note, once 3.5.0 is released with this change: https://bugs.launchpad.net/evergreen/+bug/1849152 <https://bugs.launchpad.net/evergreen/+bug/1849152> , you can do this without any template customizations at all.

Jason

-- 
Jason Boyer
Senior System Administrator
Equinox Open Library Initiative
phone:  +1 (877) Open-ILS (673-6457)
email:  JBoyer at EquinoxInitiative.org
web:  https://EquinoxInitiative.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libmail.georgialibraries.org/pipermail/open-ils-general/attachments/20200217/2cc2a8eb/attachment.html>


More information about the Open-ils-general mailing list