Using All of the Tools in Your Kit
A user-focused introduction to Template Toolkit in Koha
What is Template Toolkit (TT)?
“The Template Toolkit is a fast, flexible and highly extensible template processing system.” - https://template-toolkit.org/
Where is TT used in Koha?
A brief discussion of objects and how TT uses them
How is a toolkit better than an alligator?
An IF example
Debug, Troubleshooting, and Data::Dumper
[% USE Dumper %]�[% Dumper.dump_html( borrower )%]
[% Dumper.dump_html( borrower.unblessed )%]
A substr() example
Hold slip with partial name
A replace() example
Filter/format examples
[% borrower.surname | upper %]�[% borrower.dateexpiry | $KohaDates %]�[% some_html | html %]��[% borrower.dateexpiry | html | $KohaDates %]
Koha template plugins (helpers)
[% USE Price %]
[% item.replacementprice | $Price %] - magic with CurrencyFormat�[% item.replacementpricedate | $KohaDates %] - magic with DateFormat �[% biblio.title | $Remove_MARC_puncuation %]
Koha template plugins - Circulation rules
[% USE CirculationRules %]
[% FOREACH c IN borrower.checkouts %]
[% SET renewals = CirculationRules.Renewals( borrower.borrowernumber, c.itemnumber ) %] <br />
Renewals remaing: [% renewals.remaining %]
[% END %]
Koha template plugins -How did that work?
An example from Koha/Template/Plugin/CirculationRules.pm
Resources