Bug 18665 - Translatability: Add tt filter to allow html tags inside tt directives
authorMarc Véron <veron@veron.ch>
Wed, 24 May 2017 14:06:31 +0000 (16:06 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 21 Jun 2017 14:22:18 +0000 (11:22 -0300)
commit9c7761fe89d05fc7114f426ecffdf9635ba1fe97
treeb57d19521b616f064e487aafb59163c017942142
parent939eadc5d987429db04887623c3f260ee02b86d2
Bug 18665 - Translatability: Add tt filter to allow html tags inside tt directives

HTML tags inside template toolkit directives are not allowed because of translation issues.
Add a filter that handles HTML tags.

Note you need to write quotes ' around the text you want displayed as a
heading

To test:
- Apply patch
- Add [% USE HtmlTags %] to the top of a tt file
- Add something like [% 'My nice title' | $HtmlTags tag="h1" %] to the tt file
- Verify that in output 'My nice title' has h1 tags
- Change template directive to something like
  [% 'My nice title' | $HtmlTags tag="h1" attributes='title="This is a nice title attribute"' %]
- Verify that title attribute displays in output (source code or tooltip on 'My nice title')

Notes: - Tests are planned for a second patch
       - Update for Wiki coding guidelines

Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz>
Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/Template/Plugin/HtmlTags.pm [new file with mode: 0644]