Bug 6294

Summary: Add {BIBLIONUMBER} parsing support to SearchForTitleIn syspref
Product: Koha Reporter: Ian Walls <koha.sekjal>
Component: OPACAssignee: Ian Walls <koha.sekjal>
Status: CLOSED FIXED QA Contact: Bugs List <koha-bugs>
Severity: enhancement    
Priority: PATCH-Sent (DO NOT USE) CC: chris, nengard
Version: 3.6   
Hardware: All   
OS: All   
Change sponsored?: Sponsored Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: signed off patch

Description Ian Walls 2011-05-03 15:30:28 UTC
By adding parsing support for {BIBLIONUMBER} to the SearchForTitleIn system preference, we can enable support for APIs (like Facebook, Twitter, etc) that could point back to the items detail page for a title.

Example code to put into SearchForTitleIn (place after </ul> that comes with default):


</div></div><div class="detailtagcell">
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like href="http://opac.mylibrary.tld/bib/{BIBLIONUMBER}" show_faces="true" width="450" font=""></fb:like>
<div><a href="http://twitter.com/share" class="twitter-share-button" data-url="http://opac.mylibrary.tld/bib/{BIBLIONUMBER}" data-text="I'm reading this" data-count="horizontal">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div></div><div><div><ul>


Replace "http://opac.mylibrary.tld" with your OPAC base URL, and for Twitter, adjust the data-text attribute to whatever you like (you can parse in {TITLE} and {AUTHOR}, but beware character limits!)
Comment 1 Ian Walls 2011-05-03 15:40:46 UTC
Whoops, my mistake... </ul> must be added to make this work:  Revised sample code:

</ul></div></div><div class="detailtagcell">
<script
src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script><fb:like
href="http://opac.mylibrary.tld/bib/{BIBLIONUMBER}" show_faces="true"
width="450" font=""></fb:like>
<div><a href="http://twitter.com/share" class="twitter-share-button"
data-url="http://opac.mylibrary.tld/bib/{BIBLIONUMBER}" data-text="I'm reading
this" data-count="horizontal">Tweet</a><script type="text/javascript"
src="http://platform.twitter.com/widgets.js"></script></div></div><div><div><ul>
Comment 2 Nicole C. Engard 2011-05-03 15:48:40 UTC
Created attachment 4032 [details] [review]
signed off patch
Comment 3 Ian Walls 2011-05-06 19:46:34 UTC
Patch itself passes QA.  Particular applications, like Facebook 'like' links and such may still require refinement, but are outside the immediate scope of this enhancement (which is just the parsing of {BIBLIONUMBER}).

Tested with NULL and incorrect biblionumber values in the URL; 404 page returns as expected.
Comment 4 Chris Cormack 2011-05-07 07:38:02 UTC
Pushed, please test
Comment 5 Owen Leonard 2011-05-17 16:17:00 UTC
opac-MARCdetail.pl and opac-ISBDdetail also need a fix.
Comment 6 Nicole C. Engard 2011-05-23 20:32:15 UTC
I tried-  but I need more than copy paste to make it work - so it's on Ian to update.
Comment 7 Jared Camins-Esakov 2012-05-23 14:40:35 UTC
This appears to be working. Closing.