index_html a script, not a template
[1st: Sorry for crossposting, but now it actually makes sense] Under the topic: "Relying on scripts" in Jim Fultons IPC9 presentation on Presentation Templates http://www.zope.org/Members/jim/Info/IPC9/PresentationTemplates/index.htm "Maybe scripts, rather than templates will commonly be URL target." -- from http://www.zope.org/Members/jim/Info/IPC9/PresentationTemplates/text20.htm Until the last couple of days I'have always made DTML Methods or DTML Documents for everything that users type into the addressbar like "index_html" or "about". I.e. I start with a template and most likely end up in a template. It shouldn't be like that, should it, always. Because some of my templates might look like this: <dtml-var standard_html_header> <dtml-if "iscooluser_externalpy_orscript()"> <dtml-with foo><dtml-var showthat></dtml-with> <dtml-else> <dtml-with bar><dtml-var showthis></dtml-with> </dtml-if> <dtml-var standard_html_footer> Recently my sites are filled with sometimes three times as many python scripts as DTML objects. And Jerome Alets Zshell really opened my eyes for loosing templates. Am I alone on using templating objects for URL-hitting objects? What are the implications (performance, scalability in terms of feature changes, etc.) of using Python Scripts or External Method instead of templates? Is there a paradigm shift with these promising Page Templates (see quote above)? Advice from people with zen?!?! Trying to see as long as possible, Peter
From: "Peter Bengtsson" <mail@peterbe.com>
I.e. I start with a template and most likely end up in a template.
Am I alone on using templating objects for URL-hitting objects?
Not at all. Both patterns have their place, and making code objects primary is a relatively new idiom.
What are the implications (performance, scalability in terms of feature changes, etc.) of using Python Scripts or External Method instead of templates?
Not "instead of", but rather "in control of". The idea is that once you have more than a little code in your template, you might benefit from factoring it out into a setup Script that does a bunch of logic and then passes a set of variables to the template.
Is there a paradigm shift with these promising Page Templates (see quote above)?
I think that it has more to do with the rise of Python Scripts, although part of the Page Template philosophy is to avoid embedding non-presentation logic. Cheers, Evan @ digicool
From: "Evan Simpson"
From: "Peter Bengtsson" <mail@peterbe.com>
I.e. I start with a template and most likely end up in a template.
Am I alone on using templating objects for URL-hitting objects?
Not at all. Both patterns have their place, and making code objects primary is a relatively new idiom.
I use about an 80% - 20% mix on my sites so far. Many of form URLs are Python Scripts. The rule of thumb for me is if I have more than one <dtml-if> in the first 10 lines I make it a python script. YMMV
I think that it has more to do with the rise of Python Scripts, although part of the Page Template philosophy is to avoid embedding non-presentation logic.
I've only played with ZPT so far. What I would really like to do in my Copious Amount Of Spare Time (tm) is to port www.wejustrock.com from DTML to ZPT and make source for both versions publicly viewable. I think that would go along way to educating people on ZPT. Unfortunately I'm not even a level 1 ZPT mage.
From: "Evan Simpson"
From: "Peter Bengtsson" <mail@peterbe.com>
I.e. I start with a template and most likely end up in a template.
Am I alone on using templating objects for URL-hitting objects?
Not at all. Both patterns have their place, and making code objects primary is a relatively new idiom.
I use about an 80% - 20% mix on my sites so far. Many of form URLs are Python Scripts.
Let me clarify. 80% DTML - 20% Scripts
participants (3)
-
Evan Simpson -
Peter Bengtsson -
Steve Drees