Passing a dynamic name for a template into a simplate

9 views
Skip to first unread message

j...@webgato.com

unread,
Jan 21, 2012, 7:40:41 PM1/21/12
to aspen...@googlegroups.com
Hi All,

Does anyone know if or how one can pass in a dynamic name of a
template to a Aspen simplate page vs it being hard coded on a simplate
page?


Currently the way I have been doing this is in the 3rd ^L page

{% include projectTemplate2.tpl %}


What I would like to do is in the second ^L do something like

templateName = "projectTemplate2.tpl"


Then in 3rd ^L page do something like

{% templateName %}

I've tried several ideas and none would allow me to pass in what ever
name I wanted.

Any ideas of how to get Python + Aspen + Tornado to play nice together
here?


Thanks
-Kevin

kevin latona

unread,
Jan 25, 2012, 12:35:43 AM1/25/12
to aspen-users

Hi All,

I found a way around the problem.

It's feeling like an issue between with how Tornado Template moves
through the Aspen call chain.

I ended up creating a "routing" handler to deal with it.

Not as flexible as I would of liked it to be, but it does the job and
works for now.

If anyone figures out how to pass in a variable name to a {%
include %} statement in the 3rd page of a simplate let me know?

-Kevin

Reply all
Reply to author
Forward
0 new messages