Using with and REQUEST
Zopesters, I am trying to render a document by it's id, which is in the REQUEST namespace as 'file'. I am opviously iliterate, so I'll let the code speak: <!--#with TopFolder--> <!--#with subfolder--> <!--#var "_.getitem(['file'],1)"--> <!--#/with--> <!--#/with--> Should this not render the item whose id it stored in the 'file' variable? It works if 'file' is a property of the document I am calling this code from, but not if it is in the REQUEST namespace. The with's are there because it is in a different hirearchy. My end goal here is to let people attatch a file to an email, only after selecting the the person who it will be to. That lets Zope determine a list of "legal" attatchments, and creataes a select list. The value is the 'id' of the attatched file. Then I am asking it to render it inside the #sendmail tag so that it comes accros as plain text rather than MIME. Any ideas? -- Jason Spisak webmaster@mtear.com
I am trying to render a document by it's id, which is in the REQUEST namespace as 'file'. I am opviously iliterate, so I'll let the code speak:
<!--#with TopFolder--> <!--#with subfolder--> <!--#var "_.getitem(['file'],1)"--> <!--#/with--> <!--#/with-->
i would expect something like this to work: <!--#with TopFolder--> <!--#with subfolder--> <!--#var "_[file]" --> <!--#/with--> <!--#/with-->
Pavlos, I'm not sure why that didn't work. But I rehased it with the code outside of the sendmail tag and it worked. So then I put it back inside and it worked fine. Scary. I just copy-pasted. Well that worked was exactly as you said. The code: <!--#with BigFolder--> <!--#with SubFolder--> <!--#var "_[file]"--> <!--#/with--> <!--#/with--> Pavlos rules!, thanks again, -- Jason Spisak webmaster@mtear.com
participants (2)
-
Jason Spisak -
Pavlos Christoforou