[Koha-devel] Discussion for Bug 14757 - Allow the use of Template Toolkit syntax for slips and notices

Kyle Hall kyle.m.hall at gmail.com
Wed Feb 3 14:56:40 CET 2016


I think Jonathan has an excellent plan of attack, but it does require a
complete switchover all at once.

I would propose we continue to use the default TT tags so that we can push
this code to master while working on ensuring all notices work with the new
TT syntax. After that, we can throw the switch by converting "<<" and ">>"
to "[% " and " %]" respectively.

One of the main reasons to keep the default tags is so that librarians can
refer to TT documentation and examples with less confusion and thought.

Kyle

http://www.kylehall.info
ByWater Solutions ( http://bywatersolutions.com )
Meadville Public Library ( http://www.meadvillelibrary.org )
Crawford County Federated Library System ( http://www.ccfls.org )
Mill Run Technology Solutions ( http://millruntech.com )

On Wed, Feb 3, 2016 at 5:23 AM, Jonathan Druart <
jonathan.druart at bugs.koha-community.org> wrote:

> Hello Kyle and others,
>
> I really like the idea :)
> I don't see major issues, and the lack of editor is a wrong issue
> (what kind of editor do you want??)
> The main point is that it will be much more powerful that our current
> homemade syntax parser.
> I have already used this enhancement on bug 15705: without the TT
> syntax, I would never managed to answer the need (display a specific
> error on notifying the user, depending on what was wrong).
>
> IMO there are 3 steps to implement:
> 1/ Update existing notices to match our current TT syntax: [% var %]
> OR (and maybe better) set START_TAG and END_TAG to '<<' and '>>' and
> we have nothing to do here :)
> 2/ Take care of some specific variables we currently support:
> LibrarianFirstname, LibrarianSurname, LibrarianEmailaddress, count,
> today, ...
> 3/ Support of "repeatable": at the moment we cannot loop on elements
> with [% FOREACH %], it's a shame and frustrating
>
> Note that we already support the TT syntax in the CSV profiles (bug 12404).
>
> The main question is: could we add TT directive in newly created
> notices (see bug 15705 again)?
> I would answer yes: it will add examples and people will notice that
> something has changed. With a good help and good examples, it should
> not be too hard to understand what does the code.
>
> Cheers,
> Jonathan
>
> 2016-02-02 17:52 GMT+00:00 Kyle Hall <kyle.m.hall at gmail.com>:
> > I would like to start the discussion Marcel wanted to have at the dev
> > meeting.
> >
> > Right now, we have one bespoke syntax for slips and notices with all
> kinds
> > of caveats and limitations.
> >
> > My first instinct was that we should over time tear out this old syntax
> and
> > replace it with TT. However, there are some issues:
> >
> > 1) TT is a bit more complicated ( and more powerful of course ) than our
> > custom syntax
> > 2) We have an editor for our current syntax ( though it is somewhat
> > problematic to use at times, as not all fields in the editor are actually
> > available on the notices where they display )
> > 3) Creating an editor for TT would be somewhat non-trivial if we were to
> > replace what we have with a better and more advanced way of dealing with
> > data passed to the slip or notice.
> >
> > I'm wondering if we should, at least for the time being, consider the
> > existing notice syntax as the "basic" mode for slips and notices, and
> have
> > the ability for TT in notices and slips be an 'advanced' mode.
> >
> > Basically, that means that nothing will change for librarians. The
> current
> > syntax and editor will continue to be what they are. Instead, 'advanced'
> > users can simply start using TT in their notices and slips. What we will
> do
> > is document how to use TT in slips and notices in the manual.
> >
> > So, what I would do at this point is deprecate my replacement notices (
> > keeping the new methods where necessary for the advanced mode ), and
> create
> > some good documentation. That way we get the power of TT while retaining
> > backwards compatibility!
> >
> > What does everyone think?
> > Kyle
> >
> > http://www.kylehall.info
> > ByWater Solutions ( http://bywatersolutions.com )
> > Meadville Public Library ( http://www.meadvillelibrary.org )
> > Crawford County Federated Library System ( http://www.ccfls.org )
> >
> > _______________________________________________
> > Koha-devel mailing list
> > Koha-devel at lists.koha-community.org
> > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> > website : http://www.koha-community.org/
> > git : http://git.koha-community.org/
> > bugs : http://bugs.koha-community.org/
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20160203/9d3de30d/attachment-0001.html>


More information about the Koha-devel mailing list