[Zope-CMF] Making a CMF Document render DTML

Jean-Francois.Doyon@CCRS.NRCan.gc.ca Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Fri, 20 Sep 2002 11:21:38 -0400


Sure,

The site is http://atlas.gc.ca ...

Select a language.

On the home page there's a box bottom left, with 5 items.  Any one of those,
excpet for the glossary, takes you to textual content pages.  Those are all
CMF documents.  The CMf is used here because we are a government of canada
site, and we have a defined common lookk & feel we have to adhere to.  In my
case this defines the top left and bottom (just the greay bar) section of
the page layout.  Stuff in the "middle" is "content".  This content is
written by authors, then marked up by HTML guys.  The HTML guyus use and
take advantage of the CMF, the actions box, and the workflows, to put stuff
in, have it reviewed, approved, etc ...

BUT, as you will notice by browsing the site, the actual content section
varies widely in look, structure, and appearance. I cannot template it down
to such a level where I could render tables dynmically as part fo the
template instead of the content, because then all tables would have to live
in the exact same spot on the page, which isn't workable.

In fact as you browse you will see the tables I mentioned.  In our case, we
are a mapping site. We have lists (tables) of maps all over the place, using
a consistent look.  These are not only used in documents, but in other CMF
object types, such as featured items (From the home page, look at he
featured item, or click on others, and look at all of them, they almost ALL
have these tables).

The idea is I want to turn those table sinto a reusable component of some
kind (python script, whatever) that would render the output based on say a
list of ObjectID's (I haven't thought that part through yet). BUT I CAN'T,
because the content of a CMF object is assumed to be html or stx ... It'd be
nice if an option for dtml was added or something ... Or if I could figure
out a way to do it myself ...

So ... That's my problem.  Anyone know how to solve it? I was trying to read
through the code for DTMLMethod for instance, trying to see what methods I
can use or whatever, but it hasn't become clear to me yet.

Any help in this matter would be much appreciated, at least a place to start
looking!

thanks,
J.F.

-----Original Message-----
From: Chris Larsen [mailto:chris@silentcooperative.com]
Sent: Friday, September 20, 2002 1:13 PM
To: Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Subject: RE: [Zope-CMF] Making a CMF Document render DTML


JF-
I was reading this and can't agree more in theory, but would really like
to see how it ended up turning out in practice for you.  Do you have an
example I could see??

Merci,
Chris

-----Original Message-----
From: zope-cmf-admin@zope.org [mailto:zope-cmf-admin@zope.org] On Behalf
Of Jean-Francois.Doyon@CCRS.NRCan.gc.ca
Sent: Friday, September 20, 2002 8:03 AM
To: chrisw@nipltd.com
Cc: zope-cmf@zope.org
Subject: RE: [Zope-CMF] Making a CMF Document render DTML

Because having a single template applicable to all documents is too
restrictive.  I want people to be able to contribute documents, and take
advantage of the workflows, but not all documents will have the exact
same
layout.  In fact there's now way for me to predict what document authors
might want. BUT I do have a template that does some stuff, like the
consistent look of the site, BUT, I do no want to dictate every detail
of
the layout.  Authors have to be able to decide whether they want an
image
justified left, or right, and so on. Currently this is all done by
putting
HTML inside the CMF Document, which is fine.

The problem is that, in this particular case, we have tables that appear
all
over the site in various documents (And featured items, and news items,
etc
...).  Right now these are done as HTML inside a CMF Document.  BUT it
would
make a whole lot more sense to make these tables as re-usable components
(lists, formatted search results, whatever).  The problem is that I
cannot,
should not, and will not dictate where document authors can/should put
these
tables/lists in their documents.

So, the best bet would be to be able to put a DTML tag inside the body,
where ever the author chooses. I could tell the authors to simply use
<dtml-var "tablegenerator(item2,item5,item22)"> in their HTML code.
(Said
tables are just lists of other Zope objects)

Am I really the only one who would find this usefull?  Seems to me I
would
have the best of both worlds, a fully templated DTML aware object.  I am
fully aware of the theory of seperating content from style and all that,
but
in my world, that's just not practical enough.  Telling authors (we have
many) that ALL their documents should look the EXACT same (or at least
have
the exact same layout) isn't acceptable. Creating various templates
isn't
practical enough either, I'd have a different template for every
document!

I can think of a million uses of CMF Documents containing DTML, not the
least of which is having workflows applicable to DTML rendered
(renderable?)
content.

Help ? Please ? :)

J.F.

-----Original Message-----
From: Chris Withers [mailto:chrisw@nipltd.com]
Sent: Friday, September 20, 2002 4:23 AM
To: Jean-Francois.Doyon@ccrs.nrcan.gc.ca
Cc: zope-cmf@zope.org
Subject: Re: [Zope-CMF] Making a CMF Document render DTML


Jean-Francois.Doyon@CCRS.NRCan.gc.ca wrote:
> I would like to have the contents of the CMF Document render the dtml
within
> it, something not currently done.

Why?

Chris

_______________________________________________
Zope-CMF maillist  -  Zope-CMF@zope.org
http://lists.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests