Created attachment 45578 [details] item with a url See the image. I would love a way to define text to display for the url in an item instead of showing the big long ugly url.
I notice if you have TrackClicks enabled the links reads "Link to resource" instead of the real URL. That seems strange, because I would think that with TrackClicks enabled it would actually be /more/ important to show the actual URL, since the browser's status bar is going to show the tracking link instead of the destination URL. Of course nobody but me looks at the status bar. Perhaps the link text should always be "Link to resource?"
Created attachment 62347 [details] [review] Bug 15352: Add syspref URLLinkTextItems, defines text to display for URL URLLinkTextItems replaces the URL of an item on catalog detail pages with this placeholder. To test: 1) Apply patch and update database 2) Edit an item (not a record) and add a URL (field u) 3) Notice the detail page shows the full URL in staff client and OPAC. If this is a very long URL it looks really ugly 4) Go to Admin -> Search for URLLinkTextItems syspref 5) Type something in the textbox (eg: "This is a link") 6) Refresh the detail pages for the record on staff client and OPAC. Confirm the text you entered has replaced the URL text. 7) Confirm the link still redirects you as expected. Sponsored-by: Catalyst IT
Created attachment 62473 [details] [review] [SIGNED-OFF] Bug 15352: Add syspref URLLinkTextItems, defines text to display for URL URLLinkTextItems replaces the URL of an item on catalog detail pages with this placeholder. To test: 1) Apply patch and update database 2) Edit an item (not a record) and add a URL (field u) 3) Notice the detail page shows the full URL in staff client and OPAC. If this is a very long URL it looks really ugly 4) Go to Admin -> Search for URLLinkTextItems syspref 5) Type something in the textbox (eg: "This is a link") 6) Refresh the detail pages for the record on staff client and OPAC. Confirm the text you entered has replaced the URL text. 7) Confirm the link still redirects you as expected. Sponsored-by: Catalyst IT Signed-off-by: Owen Leonard <oleonard@myacpl.org>
I think it's better to replace the link with "Link to resource" than a free text than will not be translatable.
We could make it work like 856 - have a default text that is translatable show, if the system preference is not set. Would this be agreeable?
Created attachment 65335 [details] [review] Bug 15352 Follow - Use default text if pref not set
Added a followup to add default text, however, it seems we need to test for item.uri now as otherwise in the case of 1 items with a link/uri all other items get a blank targeted link
(In reply to Owen Leonard from comment #1) > I notice if you have TrackClicks enabled the links reads "Link to resource" > instead of the real URL. > > That seems strange, because I would think that with TrackClicks enabled it > would actually be /more/ important to show the actual URL, since the > browser's status bar is going to show the tracking link instead of the > destination URL. > > Of course nobody but me looks at the status bar. Perhaps the link text > should always be "Link to resource?" Looking at this now, I think it does make more sense to have the consistent 'Link to resource' text always. What do people think about using the URLLinkText syspref for this case as well, so we don't have to make another system preference? Will attach an alternative patch showcasing what I mean by this.
Created attachment 98784 [details] [review] Bug 15352: (alternative patch) Use URLLinkText instead of URL for item links Use the value in URLLinkText in 952$u, or if not set, use 'Link to resource'.
(In reply to Aleisha Amohia from comment #9) > Created attachment 98784 [details] [review] [review] > Bug 15352: (alternative patch) Use URLLinkText instead of URL for item links > > Use the value in URLLinkText in 952$u, or if not set, use 'Link to > resource'. I didn't obselete the others but apply this patch ON ITS OWN to test.
Created attachment 98828 [details] [review] Bug 15352: (alternative patch) Use URLLinkText instead of URL for item links Use the value in URLLinkText in 952$u, or if not set, use 'Link to resource'. Signed-off-by: Owen Leonard <oleonard@myacpl.org>
(In reply to Aleisha Amohia from comment #8) > What do people think about using the URLLinkText syspref for this case as > well, so we don't have to make another system preference? I think that makes a lot of sense
Created attachment 98832 [details] [review] Bug 15352: Use URLLinkText instead of URL for item links Use the value in URLLinkText in 952$u, or if not set, use 'Link to resource'. Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nice work everyone! Pushed to master for 20.05
Created attachment 98901 [details] [review] Bug 15352: (RM follow-up) Add missing filters Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 98905 [details] [review] Bug 15352: Do not display the link if item.uri does not exist Otherwise there is a "Link to ressource" that points to the current url
Followup Pushed, thanks Jonathan.
Created attachment 98927 [details] [review] Bug 15352: (RM follow-up) Add missing filters Damn, I missed a case in the first followup! Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
I am not sure about this one: The difference between the URL in the record and in the item is that I can define a link text for URLs in the record, but I can't for items. We are now forcing this change on everyone. Say the library has chosen "full text" on the UrlLinkText but that doesn't apply to all item urls?
(In reply to Katrin Fischer from comment #19) > I am not sure about this one: The difference between the URL in the record > and in the item is that I can define a link text for URLs in the record, but > I can't for items. We are now forcing this change on everyone. Say the > library has chosen "full text" on the UrlLinkText but that doesn't apply to > all item urls? Then we should use a new syspref?
I think I'd have preferred it as it also allows to keep the current behaviour (least surprise/no change on update)
My initial patches introduced a new syspref. Should I submit a follow up to this bug or make a new bug?
I'd like a separate pref, but maybe we should get some more opinions (Owen and me are like 1:1 so far :) ), before we create more work for you.
(In reply to Katrin Fischer from comment #21) > I think I'd have preferred it as it also allows to keep the current > behaviour (least surprise/no change on update) I think I'm with Cait on this one, especially since items aren't currently effected by the sys pref that effect records.
I would opt for the real URL instead of Link to resource if the syspref has not been enabled.
(In reply to Marcel de Rooy from comment #25) > I would opt for the real URL instead of Link to resource if the syspref has > not been enabled. Since 952$u is a repeatable subfield, I will be splitting the URL on the bar character on another report. Showing multiple Link to resource is kind of weird. Admittedly, having more URIs for one item might be exceptional, but not impossible.
On bug 24697 I finally decided to follow the preference on the item URL if there is only one URL. And show the real URL text if there are more. Please have a look there.
enhancement not pushed to 19.11.x branch
*** Bug 25483 has been marked as a duplicate of this bug. ***
Sadly I got an upset complaint about this one :( I've fixed it with jQuery to display the URLs in the items again: /* #44951 */ $("#holdings .url a").each(function(i) { var url = $( this ).attr("href"); $(this).text(url); }); It would have been great to make this optional/separately configurable from the URLs in the bibliographic record like proposed at first, the use cases are often quite different. I've filed a report for this: Bug 30329 - Make URLLinkText configurable separately for items and bibliographic records