[Bug 30289] New: Use Template::Toolkit WRAPPER to reduce template boilerplate
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 Bug ID: 30289 Summary: Use Template::Toolkit WRAPPER to reduce template boilerplate Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: dcook@prosentient.com.au QA Contact: testopia@bugs.koha-community.org If we used a Template::Toolkit WRAPPER directive, we could eliminate *a lot* of boiler plate from our templates and improve ease of maintenance. I suggest we start with the OPAC since it's smaller than the staff interface. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 --- Comment #1 from David Cook <dcook@prosentient.com.au> --- Created attachment 131649 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=131649&action=edit Koha Wrapper Template Toolkit File This is a first draft of a wrapper that can be used to provide the boiler plate for an OPAC page. Using the WRAPPER directive (http://www.template-toolkit.org/docs/manual/Directives.html#section_WRAPPER), we can reference it from opac-blah.tt using the following: [% WRAPPER koha_wrapper.inc bodyid="opac-blah" columns="two_leftside" %] This is my page content [% END %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 --- Comment #2 from David Cook <dcook@prosentient.com.au> --- Even if the community doesn't use this, I'm going to start using it for my own custom OPAC pages. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #3 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Interesting. You might convince the community even more by implementing into various opac templates. Getting it to work with a bunch of templates should show how beneficial it is. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- (In reply to Marcel de Rooy from comment #3)
Interesting. You might convince the community even more by implementing into various opac templates. Getting it to work with a bunch of templates should show how beneficial it is.
I was thinking the same thing, although I figure they need to be low-risk changes to be accepted. Maybe opac-library.pl and opac-tags.pl? I was also thinking I need to convince Owen most of all 😅. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #131649|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|OPAC |Templates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 --- Comment #5 from David Cook <dcook@prosentient.com.au> --- Created attachment 133074 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=133074&action=edit Bug 30289: Demonstrate using a WRAPPER with opac-library.pl This patch replaces template boiler plate by using the Template::Toolkit directive WRAPPER. Test plan: 1. Go to http://localhost:8080/cgi-bin/koha/opac-library.pl 2. Outputs a list of libraries 3. Go to http://localhost:8080/cgi-bin/koha/opac-library.pl?branchcode=CPL 4. Outputs details for Centerville library only FIXME: I still need to improve the handling of the <title> element and the breadcrumbs, but those shouldn't be too challenging. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- *** Bug 26381 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 --- Comment #7 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #6)
*** Bug 26381 has been marked as a duplicate of this bug. ***
I just remembered that it would be useful for Koha plugins too if they could refer to a WRAPPER so that they just worried about the core content to fill in the page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |oleonard@myacpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 --- Comment #8 from David Cook <dcook@prosentient.com.au> --- This isn't quite ready for sign off, but I'd like to get Owen's feedback before progressing this further. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |In Discussion CC| |jonathan.druart+koha@gmail. | |com --- Comment #9 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Owen what's your opinion on this? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30289 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31339 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org