[Zope-Moz] Templates anyone?

Shalabh Chaturvedi shalabh@pspl.co.in
Tue, 29 Feb 2000 20:13:09 +0530


[SC:]
>  (snipped: descrbing a possible approach to pattern objects)

[RH:]
> 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.

It's always good to have all ideas out in the open. If we had something
like a python method to do it - it would be as good and even editable
through any client. Probably we could have even both ways of doing
it. (Just like dtml and python).

Implementing "dtml producing dtml" would be tougher than providing
a python facility.

> I am curious what your implementation will be

I am too ;-)

> [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?

If fact why I proposed this is because I feel it fits well with
with wisywig editors and the like. " They" are objects.

(Following is less than half baked idea, so tread cautiously :)
When people want to create a webpage they
think "Aha! an 'HTMLPageDoc' object" and create a new one.
For constructing a HTMLPageDoc they think of other objects
they want to drop into it. These could be a 'DBTable', a
'navbar' template they've already created etc. When they want
to do heavy duty processing of form data, they think
'BackendObj' which doesn't have any html - it just returns
another HTMLPageDoc when done processing. When they
want to send mail they grab 'MailerObj' and drop it into
the 'BackendObj'.

Most of these objects are just plain old DTMLMethods and
tags with new 'labels' on top of them. But it looks better this
way, I think.

Some of this might be possible entirely in the UI without
changes to Zope. Some might require patterns, the component
tag, and other similar bulbs.

>
> [snip]
>

[RH::]
> 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.

One more thing for me to check out!

> >
> > [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.

Some custom dtml will always be there - should it be looked at
as a 'problem'?

>                                               ANd
> anyway not everything _is_ a pattern, is it.

True. Like I said above, we could have other 'building blocks' and the
component-tag for other things.

>                                                                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?

I'm not sure I get what you mean here. I would like the templates to be
open in the sense that anybody should be able to define their own templates.
This could mean, for example, that a user can 'iconize' (think ZStudio) his
own template and drag and drop it into documents, etc.

Shalabh