[Zope] - Standard Variables in DTML
David Brown
davidbro@home.com
Mon, 25 Jan 1999 13:28:54 -0800
On Mon, Jan 25, 1999 at 01:06:24PM -0800, Amos Latteier wrote:
> At 12:15 PM 1/25/99 -0800, you wrote:
> >First, it would be nice if there were an exhaustive list of variables
> >that can be accessed within a DTML document. If there is such a list,
> >could someone direct me there?
>
> Have you checked out the DTML Guide?
Yes, I have. I wish it was broken up into smaller pieces, and I'd
still want a page somewhere with a summary of all the vars. A cheat
sheet, perhaps.
> >One of the things I liked about Frontier was the template stuff, and
> >I'm slowly figuring out how to do the same sort of thing in Zope, by
> >modifying "standard_html_header" and "standard_html_footer" to set
> >up my own theme, but that's not really the right way to do it. I wish
> >I could set up something closer to Templates in Zope, and perhaps I
> >will, but it would be cool if someone beat me to it.
>
> So just out of curiosity, what is the right way to do it? I have ideas of
> my own about how to improve templating, but I wonder what you like about
> Frontier, that Zope lacks.
Well, when Frontier formats a page, it runs a template script, which
includes the original source document inside of it. You can set up
the formatting in the template, and all of your documents act as if
they were wrapped in the formatting commands setup in the template.
Right now, I could just do something like:
<!--#var template_header-->
<my stuff>
<!--#var template_footer-->
But that means that I have to remember to put those markup commands in
every document. In Frontier, you just designate the script you want as
a template, and then all of the documents pass through it. It is an easy
way to create a theme for a website.
I guess in general, what I want is even more than that. I picture a
hierarchical arrangement of formatting objects, each one iterating over
all of the documents in a folder, applying their styles to those documents.
Each folder could have its own template -- the top folder has the "global"
style, and each subfolder could have something that refines the style.
I'm sure that everything I need is already in Zope to do this, it's just
that the existing web framework either doesn't directly support it, or
(more likely) I haven't delved far enough into the framework to figure
out how to pull it off.
> Ah, this is a bit deep. The story is that Zope Documents are meant as
> templates to display content of other objects. In programmer's terms, they
> are closer to methods than objects. So in general it is difficult to access
> a Document's properties. Soon there will be Documents available which will
> be content holding documents--not templating documents. This will resolve
> your issue, but until then it is not easy.
I guess I just need to get deeper into the framework. Too bad I'm not
getting paid to do this. :)
dave