dtml-var in another directory without entity syntax
I have a DTML page that acquires some HTML from that stored in a directory called components I'd like to include one of these code snippets in my page with something like <dtml-var "components.codeSnippet1"> but when I do it this way all the angle brackets get converted into entity syntax. any suggestions on how to do this? thx -- Dave
Dave wrote:
I have a DTML page that acquires some HTML from that stored in a directory called components
I'd like to include one of these code snippets in my page with something like <dtml-var "components.codeSnippet1">
but when I do it this way all the angle brackets get converted into entity syntax.
any suggestions on how to do this?
Here are two ideas, both untested: 1) get rid of the "..." in your var stmt (this is a python scriptish kind of call) <dtml-with components> <dtml-var codeSnippet1> 2) if 'codeSnippet1' is a dtml method, try storing it as a dtml document instead Good Luck Jonathan
Small Business Services wrote at 2003-12-10 14:48 -0500:
... 2) if 'codeSnippet1' is a dtml method, try storing it as a dtml document instead
Usually, this is not a good idea. DTML Document is much more confusing than helping. I advice to use it only when one really knows why (and otherwise forget about it completely). I never used DTML Documents. -- Dieter
Dieter's response...
Small Business Services wrote at 2003-12-10 14:48 -0500:
... 2) if 'codeSnippet1' is a dtml method, try storing it as a dtml document instead
Usually, this is not a good idea.
DTML Document is much more confusing than helping. I advice to use it only when one really knows why (and otherwise forget about it completely). I never used DTML Documents.
I have been working with zope for about 4 years now and have used DTML Documents successfully on several occasions. What don't you like about them? Jonathan
Small Business Services wrote at 2003-12-11 14:46 -0500:
Dieter's response...
Usually, this is not a good idea.
DTML Document is much more confusing than helping. I advice to use it only when one really knows why (and otherwise forget about it completely). I never used DTML Documents.
I have been working with zope for about 4 years now and have used DTML Documents successfully on several occasions. What don't you like about them?
That they result in very strange and unpredictable name lookup: When you look at its "__call__" definition you see that it uses "(self.aq_explicit, client)" as "client" for the DTML template. This often just means: look for your own attributes, then look for that of "client" (and its acquistion context). If however, the DTML Document has been accessed indirectly, then lookup includes also part the the documents acquisition context. You find a problem report (from me) in the mailing list archives. The other objection: Search the mailing list archives for the numerous problems where people use "objectValues()" (or friends) in a DTML Document and are astonished that they see nothing. I answered dozens of such messages (telling them to forget about DTML Documents and always use DTML Methods). There are rare circumstances where a DTML Document may make sense (I did not meet one; but I can imagine cases). Thus, when you are an expert and you know why you use a DTML Document, use it. When you are a beginner, forget about them. -- Dieter
participants (3)
-
David Siedband -
Dieter Maurer -
Small Business Services