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.
Created attachment 131649 [details] 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 %]
Even if the community doesn't use this, I'm going to start using it for my own custom OPAC pages.
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.
(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 [U+1F605].
Created attachment 133074 [details] [review] 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.
*** Bug 26381 has been marked as a duplicate of this bug. ***
(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.
This isn't quite ready for sign off, but I'd like to get Owen's feedback before progressing this further.
Owen what's your opinion on this?