[Zope] dtml-with question
Maik Jablonski
maik.jablonski@uni-bielefeld.de
Thu, 08 Aug 2002 16:33:00 +0200
Marie Robichon wrote:
> Hi,
>
> I have a DTML-method that picks up a dictionary from an External Method,
> and should create a folder and a page template within it, but it doesn't
> work correctly:
>
> <dtml-let dictionaryvar="filescript(REQUEST)">
>
> <dtml-let mytitle="dictionaryvar['title']" body="dictionaryvar['body']"
> myid="dictionaryvar['fid']" >
>
> <dtml-call "manage_addFolder(myid, mytitle)">
>
> <dtml-with myid>
>
> <dtml-call
> "manage_addProduct['PageTemplates'].manage_addPageTemplate('index_html',
> mytitle, body)">
> </dtml-with>
> </dtml-let>
> </dtml-let>
>
> This creates a folder alright but creates the PT at the same level and
> not inside it.
>
> However if I try replacing myid in the manage add line with 'test' and
> do a <dtml-with test> it works just great. Any pointers anyone?
>
> TIA
> Marie Robichon
hi,
your error is in the dtml-with... myid is a string and not an object:
> <dtml-call "manage_addFolder(myid, mytitle)">
>
> <dtml-with myid>
so try something like this to get the object with id=myid:
<dtml-with "_.getattr(this(),myid)">
-maik