[Koha-bugs] [Bug 26381] New: Koha should provide Koha plugins with a template to use with Template::Toolkit WRAPPER

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 4 08:01:52 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26381

            Bug ID: 26381
           Summary: Koha should provide Koha plugins with a template to
                    use with Template::Toolkit WRAPPER
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Plugin architecture
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: dcook at prosentient.com.au
        QA Contact: testopia at bugs.koha-community.org

At the moment, Koha plugins have to built their own templates from scratch. 

I'm proposing that Koha provides a BLOCK or a template file that Koha plugins
can then use with the Template::Toolkit WRAPPER directive to minimize the
amount of boiler plate they have to use. 

Here is an example of a very simple "plugin_wrapper"

[% BLOCK plugin_wrapper %]
[% INCLUDE 'doc-head-open.inc' %]
    <title>Koha: [% name %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a
href="/cgi-bin/koha/plugins/plugins-home.pl">Plugins</a> › [% breadcrumb
%]</div>
<div id="doc3">
[% content %]
[% INCLUDE 'intranet-bottom.inc' %]
[% END %]

Then, in my report-step1.tt file, all I need to include is the following:

[% WRAPPER plugin_wrapper
    name = 'My Plugin'
    breadcrumb = 'My Plugin'
%]
<div>Plugin content</div>
[% END %]

I've already tested this a little bit, and it's beautiful.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.


More information about the Koha-bugs mailing list