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? I used to use Frontier, but switched to Zope becuase: a. I like to hack b. I like that Zope runs under Linux c. Python rocks d. It's free, and since this is just for fun, I didn't want to pay for Frontier (which is a wonderful product, and I would seriously consider it if I were doing this for anything other than my own amusement). 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. Also, I like including the actual document name in the footer of my pages so that if something looks weird, I know where to start looking. And since this is something I want in all my pages, it seems logical to put it in "standard_html_footer". I looked through the DTML reference, and found the <!--#var document_id--> should work, but it -- as it probably should -- returns "standard_html_footer". I'd really like to be able to get the name of the "master" document. Will I have to mine the REQUEST headers for that info, or is there a more straightforward way of doing this? dave (zope newbie, python newbie)
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? http://www.zope.org/Documentation/Guides/DTML It's a pretty good description of how to use DTML. However, since DTML can be used to access methods of Zope objects too, you need to also check out the on-line object reference, via the help tab to find out all the methods you can call from DTML on Zope objects.
I used to use Frontier, but switched to Zope becuase:
a. I like to hack b. I like that Zope runs under Linux c. Python rocks d. It's free, and since this is just for fun, I didn't want to pay for Frontier (which is a wonderful product, and I would seriously consider it if I were doing this for anything other than my own amusement).
Welcome aboard!
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.
Also, I like including the actual document name in the footer of my pages so that if something looks weird, I know where to start looking. And since this is something I want in all my pages, it seems logical to put it in "standard_html_footer". I looked through the DTML reference, and found the <!--#var document_id--> should work, but it -- as it probably should -- returns "standard_html_footer". I'd really like to be able to get the name of the "master" document. Will I have to mine the REQUEST headers for that info, or is there a more straightforward way of doing this?
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. -Amos
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
At 12:15 PM 1/25/99 -0800, David Brown wrote:
Also, I like including the actual document name in the footer of my pages so that if something looks weird, I know where to start looking. And since this is something I want in all my pages, it seems logical to put it in "standard_html_footer". I looked through the DTML reference, and found the <!--#var document_id--> should work, but it -- as it probably should -- returns "standard_html_footer". I'd really like to be able to get the name of the "master" document. Will I have to mine the REQUEST headers for that info, or is there a more straightforward way of doing this?
Why not do this: <A HREF="manage_main">Edit this page</A> No DTML required, and you can click to go instantly to the management interface for that page. No need to even bother knowing what it's called, just go in and fix the sucker. :)
On Mon, Jan 25, 1999 at 04:27:26PM -0500, Phillip J. Eby wrote:
Why not do this:
<A HREF="manage_main">Edit this page</A>
No DTML required, and you can click to go instantly to the management interface for that page. No need to even bother knowing what it's called, just go in and fix the sucker. :)
Well, certainly that solves the REAL problem, but I, being a hacker, have fixated on the original problem, and will obsess on it until I figure out how to do it. :) dave
At 01:34 PM 1/25/99 -0800, David Brown wrote:
On Mon, Jan 25, 1999 at 04:27:26PM -0500, Phillip J. Eby wrote:
Why not do this:
<A HREF="manage_main">Edit this page</A>
No DTML required, and you can click to go instantly to the management interface for that page. No need to even bother knowing what it's called, just go in and fix the sucker. :)
Well, certainly that solves the REAL problem, but I, being a hacker, have fixated on the original problem, and will obsess on it until I figure out how to do it.
:)
dave
One way: <!--#var "standard_html_footer(_.None,_,document_id=document_id)"--> This'll pass the document_id in as a parameter. Another way, that only needs to be done in standard_html_footer itself: <!--#var "URL0[_.len(URL1)+1:]"--> Should give you the last part of the URL (I think). What I'm trying to say there is, "Take the URL0 variable, and skip over the part that's the same as URL1, leaving the last part of URL0."
participants (3)
-
Amos Latteier -
David Brown -
Phillip J. Eby