[dancer-users] Having multiple INCLUDE_PATH for the Template Toolkit engine

Gabor Szabo gabor at szabgab.com
Tue Nov 10 07:06:12 GMT 2015


HI,

The Perl Maven and the Code Maven sites run using the same code-base and
thus the same
set of templates in the views directory.
https://github.com/szabgab/Perl-Maven

I'd like to have some additional templates that differ in the two sites,
but I don't want to have two separate sets of templates.

So I wanted to add multiple views directories which worked in the config
file like this

engines:
  template:
    template_toolkit:
      encoding:  'utf8'
      INCLUDE_PATH:
        - 'views'
        - 'config/templates'
      start_tag: '<%'
      end_tag:   '%>'


but I'd like to set this during the run-time,  for example in the 'before'
hook.

So far I could not do it.

I tried  set views => [dir1, dir1]    but does not work as views is
required to be a string.

I could not figure out how else to change the INCLUDE_PATH during run-time.

Is there a solution? If currently not,would it be possible to allow views
to be either a string or an array ref to strings?

regards
    Gabor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20151110/877ba640/attachment.html>


More information about the dancer-users mailing list