Bug 7709 - Cover Images Template plugin
Summary: Cover Images Template plugin
Status: RESOLVED DUPLICATE of bug 28180
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-13 19:32 UTC by Ian Walls
Modified: 2022-08-22 02:50 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Walls 2012-03-13 19:32:52 UTC
As we add more and more sources for cover images, and use them in more and more places, it becomes increasingly difficult to keep the code synchronized.  I propose we move the logic of picking and displaying a cover image out of the templates and into a T:T Plugin.

Usage would be like:

[% biblionumber | KohaCoverImage %]

I say biblionumber instead of normalised_isbn (which is common for most all external services) because it will also work for local cover images.  This does add the overhead of having to look up the normalized ISBN again, even if we already had it on the page.  Anyone more familiar with passing variables (particularly hashes) to T:T plugins, would be welcome to step up here.

This would simplify out templates by several dozen lines of code, and provide a uniform logic for selection.  New selection methods, as well as new sources, would be easy to add, since they'd only need to be coded in one place.
Comment 1 Magnus Enger 2012-08-31 11:29:25 UTC
Look for "dynamic filters" on this page: http://template-toolkit.org/docs/modules/Template/Plugin/Filter.html
Comment 2 Fridolin Somers 2013-08-30 13:15:51 UTC
Using a filter is odd I think.
Maybe something more like : [% Cover.getImage( biblionumber ) %]
Comment 3 David Cook 2022-08-22 02:50:11 UTC

*** This bug has been marked as a duplicate of bug 28180 ***