Re: [dancer-users] tt tags
There was a thread on this back in November: http://lists.preshweb.co.uk/pipermail/dancer-users/2015-November/005294.html http://lists.preshweb.co.uk/pipermail/dancer-users/2015-November/005297.html This is what I need in config.yml to make it work (is there a simpler way?): template: "template_toolkit" charset: UTF-8 engines: template: template_toolkit: ENCODING: utf8 INCLUDE_PATH: 'views' start_tag: '[%' end_tag: '%]' WRAPPER: layouts/emails.tt In a pm: my $email_body = template( 'emails/activate.tt', \%fields, ); In a tt: [% FILTER html_para %] Bonjour / Hello [% name %] .. On Sun, Jan 17, 2016 at 7:00 AM, <dancer-users-request@dancer.pm> wrote: From: Kadir Beyazl? <kadirbeyazli@gmail.com>
On Sat, Jan 16, 2016 at 1:09 AM, Kadir Beyazl? <kadirbeyazli@gmail.com> wrote:
Hi,
I checked from following article that config.yml is correct for template toolkit parameters:
http://search.cpan.org/~xsawyerx/Dancer2-0.157001/lib/Dancer2/Manual/Migrati...
Why does not my code use '<%' and '%>' tags although they are defined at config.yml? It is working by using default tags '[%' '%]'. I am writing config.yml content again:
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
On Sat, Jan 16, 2016 at 12:54 AM, Kadir Beyazl? <kadirbeyazli@gmail.com> wrote:
When I changed tag from <% %> to [% %] at .tt file it worked. But it is defined as follow at config.yml so <% %> tags should work.
template: "template_toolkit" # I deleted this line engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
On Sat, Jan 16, 2016 at 12:40 AM, Kadir Beyazl? <kadirbeyazli@gmail.com
wrote:
Hi All,
My project at my local pc was working when I tried 2 weeks ago. Now I tried but realized that template toolkit parameters are not set. I see following when I click on "View Page Source"
<html lang="tr"> <head>
<title>adopen</title> <meta charset="<% settings.charset %>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="<% request.uri_base %>/css/bootstrap.min.css"> <script src="<% request.uri_base
%>/javascripts/jquery.min.js"></script>
<script src="<% request.uri_base %>/javascripts/bootstrap.min.js"></script> <link rel="stylesheet" href="<% request.uri_base %>/css/mystyle.css" />
I checked config.yml whether I changed start-end tag of template toolkit but I see that it is corrrect.
# config.yml template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
What may problem be? Last week I upgraded Ubuntu version from 15.04 to 15.10 but this should not be reason. I installed Dancer2, Template again in case upgrade caused a problem but nothing changed
I am starting my project with plackup command An HTML attachment was scrubbed... URL: < http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160116/aaf5...
-- Rick Leir Developer, Canadiana.ca
Hi Rick, On Mon, Jan 18, 2016 at 4:04 PM, Rick Leir <richard.leir@canadiana.ca> wrote:
There was a thread on this back in November: http://lists.preshweb.co.uk/pipermail/dancer-users/2015-November/005294.html http://lists.preshweb.co.uk/pipermail/dancer-users/2015-November/005297.html
This is what I need in config.yml to make it work (is there a simpler way?): template: "template_toolkit" charset: UTF-8 engines: template: template_toolkit: ENCODING: utf8 INCLUDE_PATH: 'views' start_tag: '[%' end_tag: '%]' WRAPPER: layouts/emails.tt
In a pm: my $email_body = template( 'emails/activate.tt', \%fields, );
In a tt: [% FILTER html_para %] Bonjour / Hello [% name %]
[KB] I know that start and end tags of template toolkit can be defined at config.yml but my problem is that .tt file does not accept the tags I defined at config.yml. I defined as follow. template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>' And at .tt file I use as follow : <% order %> But .tt file is still accepting '[%' and '%]'. I am triyng to understand answer of this issue. I checked my .pm files whether I overrided template tookit parameters but I did not see any code related with it. Ant the strange thing is that my code was working (accepting tags '<%' and '%>') 2 weeks ago. I only updated my Ubuntu operating system, upgraded Dancer2 from 061 to 066 and this occurred. I realized that at new Daner2 version, TemplateToolkit.pm changed, so I turned back to old version thinking this caused problem but it is still same.
On Sun, Jan 17, 2016 at 7:00 AM, <dancer-users-request@dancer.pm> wrote:
From: Kadir Beyazl? <kadirbeyazli@gmail.com> On Sat, Jan 16, 2016 at 1:09 AM, Kadir Beyazl? <kadirbeyazli@gmail.com> wrote:
Hi,
I checked from following article that config.yml is correct for template toolkit parameters:
http://search.cpan.org/~xsawyerx/Dancer2-0.157001/lib/Dancer2/Manual/Migrati...
Why does not my code use '<%' and '%>' tags although they are defined at config.yml? It is working by using default tags '[%' '%]'. I am writing config.yml content again:
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
On Sat, Jan 16, 2016 at 12:54 AM, Kadir Beyazl? <kadirbeyazli@gmail.com> wrote:
When I changed tag from <% %> to [% %] at .tt file it worked. But it is defined as follow at config.yml so <% %> tags should work.
template: "template_toolkit" # I deleted this line engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
On Sat, Jan 16, 2016 at 12:40 AM, Kadir Beyazl? <kadirbeyazli@gmail.com> wrote:
Hi All,
My project at my local pc was working when I tried 2 weeks ago. Now I tried but realized that template toolkit parameters are not set. I see following when I click on "View Page Source"
<html lang="tr"> <head>
<title>adopen</title> <meta charset="<% settings.charset %>"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="<% request.uri_base %>/css/bootstrap.min.css"> <script src="<% request.uri_base %>/javascripts/jquery.min.js"></script> <script src="<% request.uri_base %>/javascripts/bootstrap.min.js"></script> <link rel="stylesheet" href="<% request.uri_base %>/css/mystyle.css" />
I checked config.yml whether I changed start-end tag of template toolkit but I see that it is corrrect.
# config.yml template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
What may problem be? Last week I upgraded Ubuntu version from 15.04 to 15.10 but this should not be reason. I installed Dancer2, Template again in case upgrade caused a problem but nothing changed
I am starting my project with plackup command An HTML attachment was scrubbed... URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160116/aaf59bba/attachment-0001.html>
-- Rick Leir Developer, Canadiana.ca
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Kadir Beyazlı Computer Engineer GSM : +90 535 821 50 00
On Tue, 2016-01-19 at 00:06 +0200, Kadir Beyazlı wrote:
[KB] I know that start and end tags of template toolkit can be defined at config.yml but my problem is that .tt file does not accept the tags I defined at config.yml. I defined as follow.
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
And at .tt file I use as follow :
<% order %>
But .tt file is still accepting '[%' and '%]'.
I can only think that your config files is not being read properly or it is being overwritten when multiple configs are merged. Try dumping the entire config in your app and seeing what it contains ("print Dumper config" or similar).
upgraded Dancer2 from 061 to 066 and this occurred.
I've just tried with 0.166 and it's working for me. You could also try creating a new app: dancer2 -a myapp then un-commenting the TT config in the generated config.yml If that works, then you have an error in your app somewhere, most likely in the config parsing/compilation. Andy
Hi Andrew, I completely debugged TemplateToolkit.pm. There is change at this file but this is not the reason of my problem I tried several things and found problem! At config.yml I have following definitions, template toolkit parameters do not work! template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>' session: YAML engines: session: YAML: session_dir: /home/kadir/dancer-sessions But when I change their place (session definition first), it works: session: YAML engines: session: YAML: session_dir: /home/kadir/dancer-sessions template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>' I also Dumped config and realized that anything is not known defined before session. It is strange to me. On Tue, Jan 19, 2016 at 12:46 AM, Andrew Beverley <andy@andybev.com> wrote:
On Tue, 2016-01-19 at 00:06 +0200, Kadir Beyazlı wrote:
[KB] I know that start and end tags of template toolkit can be defined at config.yml but my problem is that .tt file does not accept the tags I defined at config.yml. I defined as follow.
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
And at .tt file I use as follow :
<% order %>
But .tt file is still accepting '[%' and '%]'.
I can only think that your config files is not being read properly or it is being overwritten when multiple configs are merged. Try dumping the entire config in your app and seeing what it contains ("print Dumper config" or similar).
upgraded Dancer2 from 061 to 066 and this occurred.
I've just tried with 0.166 and it's working for me. You could also try creating a new app:
dancer2 -a myapp
then un-commenting the TT config in the generated config.yml
If that works, then you have an error in your app somewhere, most likely in the config parsing/compilation.
Andy
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Kadir Beyazlı Computer Engineer GSM : +90 535 821 50 00
Hi, As I understand from this experience, "engines" parameters must be defined only once at config.yml For both "template toolkit" and "session", I had defined parameter "engines" and last one overrided earlier ones I think correct definition should be as follow session: YAML template: "template_toolkit" engines: session: YAML: session_dir: /home/kadir/dancer-sessions template: template_toolkit: start_tag: '<%' end_tag: '%>' On Tue, Jan 19, 2016 at 12:53 AM, Kadir Beyazlı <kadirbeyazli@gmail.com> wrote:
Hi Andrew,
I completely debugged TemplateToolkit.pm. There is change at this file but this is not the reason of my problem I tried several things and found problem!
At config.yml I have following definitions, template toolkit parameters do not work!
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
session: YAML engines: session: YAML: session_dir: /home/kadir/dancer-sessions
But when I change their place (session definition first), it works:
session: YAML engines: session: YAML: session_dir: /home/kadir/dancer-sessions
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
I also Dumped config and realized that anything is not known defined before session. It is strange to me.
On Tue, Jan 19, 2016 at 12:46 AM, Andrew Beverley <andy@andybev.com> wrote:
On Tue, 2016-01-19 at 00:06 +0200, Kadir Beyazlı wrote:
[KB] I know that start and end tags of template toolkit can be defined at config.yml but my problem is that .tt file does not accept the tags I defined at config.yml. I defined as follow.
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
And at .tt file I use as follow :
<% order %>
But .tt file is still accepting '[%' and '%]'.
I can only think that your config files is not being read properly or it is being overwritten when multiple configs are merged. Try dumping the entire config in your app and seeing what it contains ("print Dumper config" or similar).
upgraded Dancer2 from 061 to 066 and this occurred.
I've just tried with 0.166 and it's working for me. You could also try creating a new app:
dancer2 -a myapp
then un-commenting the TT config in the generated config.yml
If that works, then you have an error in your app somewhere, most likely in the config parsing/compilation.
Andy
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Kadir Beyazlı Computer Engineer GSM : +90 535 821 50 00
-- Kadir Beyazlı Computer Engineer GSM : +90 535 821 50 00
On Tue, Jan 19, 2016 at 9:46 AM, Kadir Beyazlı <kadirbeyazli@gmail.com> wrote:
Hi,
As I understand from this experience, "engines" parameters must be defined only once at config.yml For both "template toolkit" and "session", I had defined parameter "engines" and last one overrided earlier ones I think correct definition should be as follow
session: YAML template: "template_toolkit"
engines: session: YAML: session_dir: /home/kadir/dancer-sessions template: template_toolkit: start_tag: '<%' end_tag: '%>'
I think you're right there. As a general rule I try to avoid touching the config.yml since I've spent hours debugging things like cookie issues only to realise it was actually something in the .yml file wasn't defined in the right place or was overriding something else, or was it? I vote for config.json :)
On Tue, Jan 19, 2016 at 12:53 AM, Kadir Beyazlı <kadirbeyazli@gmail.com> wrote:
Hi Andrew,
I completely debugged TemplateToolkit.pm. There is change at this file but this is not the reason of my problem I tried several things and found problem!
At config.yml I have following definitions, template toolkit parameters do not work!
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
session: YAML engines: session: YAML: session_dir: /home/kadir/dancer-sessions
But when I change their place (session definition first), it works:
session: YAML engines: session: YAML: session_dir: /home/kadir/dancer-sessions
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
I also Dumped config and realized that anything is not known defined before session. It is strange to me.
On Tue, Jan 19, 2016 at 12:46 AM, Andrew Beverley <andy@andybev.com> wrote:
On Tue, 2016-01-19 at 00:06 +0200, Kadir Beyazlı wrote:
[KB] I know that start and end tags of template toolkit can be defined at config.yml but my problem is that .tt file does not accept the tags I defined at config.yml. I defined as follow.
template: "template_toolkit" engines: template: template_toolkit: start_tag: '<%' end_tag: '%>'
And at .tt file I use as follow :
<% order %>
But .tt file is still accepting '[%' and '%]'.
I can only think that your config files is not being read properly or it is being overwritten when multiple configs are merged. Try dumping the entire config in your app and seeing what it contains ("print Dumper config" or similar).
upgraded Dancer2 from 061 to 066 and this occurred.
I've just tried with 0.166 and it's working for me. You could also try creating a new app:
dancer2 -a myapp
then un-commenting the TT config in the generated config.yml
If that works, then you have an error in your app somewhere, most likely in the config parsing/compilation.
Andy
_______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
-- Kadir Beyazlı Computer Engineer GSM : +90 535 821 50 00
-- Kadir Beyazlı Computer Engineer GSM : +90 535 821 50 00 _______________________________________________ dancer-users mailing list dancer-users@dancer.pm http://lists.preshweb.co.uk/mailman/listinfo/dancer-users
participants (4)
-
Andrew Beverley -
David H -
Kadir Beyazlı -
Rick Leir