From: "Marc Chantreux" <[email protected]>
> On Thu, Nov 26, 2009 at 12:57:18PM +0100, Harald Joerg wrote:
>> > Is it possible to interpret somehow page_body variable to be processed
>> > like
>> > a template?
>
> why just not PROCESS data file ? do you plane to generate templates on
> fly ? that means you can't cache and i imagine you can have serious
> performance issues. isn't it possible to write functions (BLOCK) and
> WRAPPERs ?
>
No I don't generate templates dynamicly, but if I put just simple html code
in the database I would also need to hard-code the links, and in that case
they will be harder to modify in case I would need to modify the
application.
For example now the web app runs on the root url (/) but in the future I
might need to put it run on a sub-virtual-directory like /something/.
If I define the urls using [% c.uri_for('/test') %]
this URL will become http://www.mysite.ro/test
but in the future if I would put the app to run on /something/, it will
automaticly become
http://www.mysite.ro/something/test
without changing anything.
And the truth is that I am not thinking only to the future. I also rewrite
the URL so the language of the current page becomes the first part of the
URL like:
http://www.mysite.ro/en/test
I would need to put the same urls in the pages for all the languages and
they would get their language automaticly.
But thank you for reminding about the performance. I will make some tests
and if the performance degrades, I will make the effort of storing only
static content.
Octavian
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates