[Zope] On DTML and Python Script.

2000-12-05 Thread Harris Peter

Jason Leach writes...
Message: 9
Date: Mon, 4 Dec 2000 12:36:26 -0800 (PST)
From: "Jason C. Leach" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: [Zope] On DTML and Python Script.

hi,

For Christmas I'd like a way to be able to use PHP or ASP type
scripting
rather than DTML.

like:

%py

My python Script or Code.

py%

Or
dtml

My DTML.

/dtml

Having to manager all those dtml  and tags is not as good as it
could
be.  I suspect it's more of a deturant than anything else. I do
agree that
DMTL should be use as little as possible with Python used for
anything
over 10 lines.  But why have a scripting language for both methods
over
and under 10 lines?

j.

..
. Jason C. Leach
... University College of the Cariboo.

Yekk, no !  
I use Progress WebSpeed at work. Webspeed does something
similar to what you suggest, only with Progress 4GL
embedded in the HTML between certain tags.

This is OK at first, but it often gets ugly, especially where you
are jumping in and out of 4GL just to do simple conditionals or
iterations that DTML makes not too painful with dtml-if and
dtml-in.

OK, I am one of those poor fools who is trying to do too much
in DTML. But it's not too bad as long as you factor it out well
and keep any messy code in DTML methods rather than
mixed in with your HTML.

Just my opinion, though.

Peter Harris



This message and any files transmitted with it are confidential.  
The contents may not be disclosed or used by anyone other 
than the addressee. 
If you have received this communication in error, please delete 
the message and notify JBB (Greater Europe) Plc immediately 
on 0141-249-6285.

The views expressed in this email are not necessarily the views 
of JBB (Greater Europe) PLC.  
 As it has been transmitted over a public network, 
JBB (Greater Europe) PLC makes no representation nor accepts 
any liability for the email's accuracy or completeness unless 
expressly stated to the contrary.

Should you, as the intended recipient, suspect that the message 
has been intercepted or amended, please notify 
JBB (Greater Europe) Plc immediately on 0141-249-6285.



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] On DTML and Python Script

2000-12-05 Thread Phill Hugo

Jason Leach pointed out that Document Template could include ASP/PHP
style Python escapes to embed code. This may seem a good idea at first
but part of the really nice thing about Zope is that it goes a fair way
to ensure you organise your work cleanly and seperate logic from the
layout.

In PHP I always use FastTemplate which offers pretty much only what
dtml-var VARIABLE_NAME does (that doesn't include dtml-var
"VAR1+VAR2" or anything "clever"). The benefit of having no logic in
your HTML is huge when you have multiple people working on the project.
The "creep" of template systems to hold more and more logic such as
Loops, Conditions etc is forgivable as it allows basic programming to be
done by the HTML people but strictly it isn't necessary as long a
variable insertion / tag replacement is possible.

If you are "having to [use] all those dtml tags" then you're probably at
the point where replacing that big chunk with dtml-var welcomeMessage
is in order. This could be anything you want (Python method, External
Method, DTML method etc) which does the real logic and conditionally
returns its output to the master template (that content possibly from
another smaller, reused DTML method - it amazing how many sites use the
same text all over it (like Next 10, Prev 10 for example!).

At that point you've removed any fear of the HTML people walking over
your code with a bulldozer and it means they can update things while you
do.

What I'm suggesting is that %, ?php and %py are Bad Things. If you
want them, use ASP with Python hosted inside or PHP. Much of the benefit
of Zope is that it keeps things elegant. The overhead of splitting
things up so much is small when you start to reuse the bits (by my
milage this is on regular occasion).

Even the dtml-if, dtml-in and dtml-let tags could be argued to be
Bad Things but they are convenient in some cases (they are easy for HTML
writers to understand and can be used for simple things by them).

I don't really see the "convenience" of a Python code escape as its just
as easy to make a Python Method and pop dtml-var MyPythonMethod in its
place keeping things neat.

Still, I suppose it'd hardly matter if it was available, those who agree
with the above would probably ignore it, much as I ignore it in PHP and
use FastTemplate instead.

Phill

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] On DTML and Python Script.

2000-12-04 Thread Jason C. Leach

hi,

For Christmas I'd like a way to be able to use PHP or ASP type scripting
rather than DTML.

like:

%py

My python Script or Code.

py%

Or
dtml

My DTML.

/dtml

Having to manager all those dtml  and tags is not as good as it could
be.  I suspect it's more of a deturant than anything else. I do agree that
DMTL should be use as little as possible with Python used for anything
over 10 lines.  But why have a scripting language for both methods over
and under 10 lines?

j.

..
. Jason C. Leach
... University College of the Cariboo.
.. 


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )