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