Hi all, I have a problem that looks simple (if not trivial) : I would like to "render" a DTML Document using a DTML Method. The DTMLDoc is "mydoc", has a title (="My Document") and a content (="I am the doc content") The DTMLMethod is "render" and its code is : """ I am rendering the <dtml-var title_or_id> page ! """ And, at last, I have a index_html like this : """ <dtml-with mydoc> <dtml-var render> </dtml-with> """ (All the items are in the same folder , whose id=test and no title) When viewing http://localhost:8080/test/ the result I expect is : I am rendering the My Document page ! OK ? But I got : I am rendering the test page ! THE <DTML-WITH> DID NOTHING !!!!!! What makes me become crasy is that http://localhost:8080/test/mydoc/render works as expected !!! : I am rendering the My Document page ! Can anyone explain me this ? And by the way give a solution to my problem ??? Of course I cannot use the http://localhost:8080/test/mydoc/render notation. Thanx for reading that far. Olivier.
+-------[ Olivier Deckmyn ]---------------------- | Hi all, | """ | <dtml-with mydoc> | <dtml-var render> | </dtml-with> Why don't you just do <dtml-var mydoc> ? you can also do <dtml-var "mydoc.render(_.None,_)"> I suppose -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
I tried <dtml-var "mydoc.render(_.None,_)"> .... The same result : does'nt work...(exactly like with the <dtml-with> tag....) ----- Original Message ----- From: "Andrew Kenneth Milton" <akm@mail.theinternet.com.au> To: "Olivier Deckmyn" <odeckmyn.list@teaser.fr> Cc: <zope@zope.org> Sent: Tuesday, January 23, 2001 2:43 PM Subject: Re: [Zope] Trivial challenge ?
+-------[ Olivier Deckmyn ]---------------------- | Hi all,
| """ | <dtml-with mydoc> | <dtml-var render> | </dtml-with>
Why don't you just do <dtml-var mydoc> ?
you can also do <dtml-var "mydoc.render(_.None,_)"> I suppose
-- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
+-------[ Olivier Deckmyn ]---------------------- | I tried <dtml-var "mydoc.render(_.None,_)"> .... | | The same result : does'nt work...(exactly like with the <dtml-with> tag....) and <dtml-var mydoc> ? -- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
this is not what I need !!! Yes : <dtml-var mydoc> displays the content of the document... But I don't need this. The example I gave is a simplified pb of my __real_world__ problem ... Just to show the interessting point ! My __real_world__ document has several properties, etc... and a I have a lot of renderers (this explains that...) Thanx ! ----- Original Message ----- From: "Andrew Kenneth Milton" <akm@mail.theinternet.com.au> To: "Olivier Deckmyn" <odeckmyn.list@teaser.fr> Cc: "Andrew Kenneth Milton" <akm@mail.theinternet.com.au>; <zope@zope.org> Sent: Tuesday, January 23, 2001 3:12 PM Subject: Re: [Zope] Trivial challenge ?
+-------[ Olivier Deckmyn ]---------------------- | I tried <dtml-var "mydoc.render(_.None,_)"> .... | | The same result : does'nt work...(exactly like with the <dtml-with> tag....)
and <dtml-var mydoc> ?
-- Totally Holistic Enterprises Internet| P:+61 7 3870 0066 | Andrew Milton The Internet (Aust) Pty Ltd | F:+61 7 3870 4477 | ACN: 082 081 472 ABN: 83 082 081 472 | M:+61 416 022 411 | Carpe Daemon PO Box 837 Indooroopilly QLD 4068 |akm@theinternet.com.au|
Olivier Deckmyn wrote:
this is not what I need !!!
Yes : <dtml-var mydoc> displays the content of the document... But I don't need this. The example I gave is a simplified pb of my __real_world__ problem ... Just to show the interessting point !
My __real_world__ document has several properties, etc... and a I have a lot of renderers (this explains that...)
Have you considered that you might have simplified out the problem too much, so that the actual problem isn't present in your example? cheers, Chris
On 23 Jan 2001, at 14:17, Chris Withers wrote:
Olivier Deckmyn wrote:
this is not what I need !!!
Yes : <dtml-var mydoc> displays the content of the document... But I don't need this. The example I gave is a simplified pb of my __real_world__ problem ... Just to show the interessting point !
My __real_world__ document has several properties, etc... and a I have a lot of renderers (this explains that...)
Have you considered that you might have simplified out the problem too much, so that the actual problem isn't present in your example?
Funny. I think he gave a good description of the problem. I've fallen into this trap too, when I started using Zope. I too consider the behaviour somewhat odd, and don't like the current state of affairs, where fiddling around with various partially implemented syntactic constructs gives quicker results than searching the documentation, or having a simple mental model of how it "is assumed to work". Olivers mental model of how the evaluation of a dtml constructs obviously doesn't give him the right clues. IMHO, this isn't Olivers fault, but an indication that there is something wrong with dtml. Btw, I believe that <dtml-var "render(mydoc)"> is the easiest way to express what he wants. But what do I know. :-} -- Wolfgang Strobl
Olivier Deckmyn wrote:
this is not what I need !!!
Yes : <dtml-var mydoc> displays the content of the document... But I don't need this. The example I gave is a simplified pb of my __real_world__ problem ... Just to show the interessting point !
My __real_world__ document has several properties, etc... and a I have a lot of renderers (this explains that...)
Thanx !
I think it's time for your document to be an instance of a ZClass. -- Tim Cook, President -- Free Practice Management,Inc. | http://www.FreePM.com Office: (901) 884-4126 "Liberty has never come from the government." - Woodrow Wilson
participants (5)
-
Andrew Kenneth Milton -
Chris Withers -
Olivier Deckmyn -
Tim Cook -
Wolfgang Strobl