[Zope-Moz] Templates anyone?

Rik Hoekstra rik.hoekstra@inghist.nl
Tue, 29 Feb 2000 12:52:03 +0100


> 
> HTMLgen could be easy and all, no doubt. It is probably even
> more powerful than what is required for just creating dtml
> from 'patterns'.
> 
> What I am concerned about is that for a user wanting to use
> this, there would be this 'something' extra he has to learn.
> I feel it's important to have as little new learning required as
> possible. Ideally plain dtml users should be able to go and
> create their own patterns and use them.
> 
> I was just thinking of "dtml producing dtml". Consider:
> 
> <dtml-in columnNames>
>    <td> [dtml-var <dtml-var id>]
> </dtml-in>
> 
> For columnNames = ['Name','Age'],
> this would normally produce:
> 
> <td> [dtml-var Name]
> <td> [dtml-var Age]
> 
> When evaluated as a pattern, it could produce:
> 
> <td> <dtml-var Name>
> <td> <dtml-var Age>
> 
> The above _could_ be _one_ way to do the first evaluation
> (Pattern->DTML). This would have it's pitfalls, I'm sure, but
> they have to weighed against the advantages. One big
> advantage I see is it would be easy to do for dtml users.

Well, OK, but that's just about the same as my external method worked
when I tested it... Not that I want to push HTMLgen; it was just a
thought. I am curious what your implementation will be

[snip]

> 
> I don't know how important the dichotomy problem you mentioned
> is to the community but I think the present scheme, although providing
> great flexibility, allows for a complete hotchpotch website design.

Dare I mention ASP?

> Almost everything is done in a DTMLDocument (or Method):
>  - Visible Pages
>  - Updates to persistent objects
>  - Control Flow depending on state and user interaction
>  - etc.
> 
> As a result, users might create a number of DTMLDocs which
> lie on top of one another, each putting in some 'visible' element,
> doing some lookup, control flow etc.
> 
> It might be more productive provide the user a wider range
> of building blocks (than just DTMLDoc), that guide him to
> a more modular and better architected website. This might
> even make it easier to determine what objects are to
> rendered, partially-rendered etc and when.

I like this idea. On the other hand, you will still have to deal with
people whining about wanting to use wysiwyg editors. I gather this will
not be easy to reconcile with you structured approach, unless they are
objects. DO you have a solution in mind for it?

[snip]

> [RH::]
> > Sounds good, useful and doable. Of course this only works for real standard
> > patterns.
> 
> Depends on what you mean by real standard patterns.
> Every user might have some pattern he uses often and
> he wants to reuse. Some patterns might be integrated
> with the Studio (or even PTK?).

Of course. The ZDP also has a ZSnippets project started, which are in
fact (mini) patterns of 'this way we do such and such a task in zope'.
Might be a source of pattern objects.

> 
> [RH::]
> >              You would still be left with custom dtml written by people.
> 
> Yes. Any solutions you have in mind?
> 

Nope. I don't think you will be able to circumvent this altogether. ANd
anyway not everything _is_ a pattern, is it. You could introduce
something like an 'open pattern' (which is of course a contradiction),
but I am not at all sure this is a good idea. THe question is of course
if you want to keep templates open or if you only want to compose them
of objects. Any thoughts on this?

Rik