Re: [Zope] Open an HTML file in zope
Thanks a lot..It worked.. Andreas Jung [EMAIL PROTECTED] wrote: --On 18. Juni 2008 10:14:10 +0100 sujitha mary wrote: Hi, I need to open and display an HTML file in zope.For that I uploaded the file as DTML document and tried to retrieve it from a page template.this is code which i wrote for this: tal:replace=here/PH226this will 'PH226' is the name of my uploaded file. This will only work if the PH226 can be _aquired_ from your current context object (check with The Zope Book 2.7 edition about _ACQUISITION_ - one of the Zope core concepts. If i need to display more than one file at a time wht should i do?i tried to modify my code for displaying the files which is selected by the user thru' a form.But it didn't work: This is the piece of code which i used this will Acquisition also applies here. tal:replace=python: getattr(context, x) An alternative to acquisition for getting an object is traveral (restrictedTraverse('/path/to/object'). I strongly recommend reading the basic Zope documentation first in order to understand how acquistion works. -aj - Bollywood, fun, friendship, sports and more. You name it, we have it.___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Open an HTML file in zope
Hi, I need to open and display an HTML file in zope.For that I uploaded the file as DTML document and tried to retrieve it from a page template.this is code which i wrote for this: pre span tal:condition=python:n=='geneprot' tal:replace=here/PH226this will /span/pre 'PH226' is the name of my uploaded file. If i need to display more than one file at a time wht should i do?i tried to modify my code for displaying the files which is selected by the user thru' a form.But it didn't work: This is the piece of code which i used span tal:define=x request/phageid pre span tal:condition=python:n=='geneprot' tal:replace=here/xthis will /span/pre/span - Explore your hobbies and interests. Click here to begin.___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Open an HTML file in zope
--On 18. Juni 2008 10:14:10 +0100 sujitha mary [EMAIL PROTECTED] wrote: Hi, I need to open and display an HTML file in zope.For that I uploaded the file as DTML document and tried to retrieve it from a page template.this is code which i wrote for this: pre span tal:condition=python:n=='geneprot' tal:replace=here/PH226this will /span/pre 'PH226' is the name of my uploaded file. This will only work if the PH226 can be _aquired_ from your current context object (check with The Zope Book 2.7 edition about _ACQUISITION_ - one of the Zope core concepts. If i need to display more than one file at a time wht should i do?i tried to modify my code for displaying the files which is selected by the user thru' a form.But it didn't work: This is the piece of code which i used span tal:define=x request/phageid pre span tal:condition=python:n=='geneprot' tal:replace=here/xthis will/span/pre/span Acquisition also applies here. tal:replace=python: getattr(context, x) An alternative to acquisition for getting an object is traveral (restrictedTraverse('/path/to/object'). I strongly recommend reading the basic Zope documentation first in order to understand how acquistion works. -aj pgpFBL1dxN62i.pgp Description: PGP signature ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Open an HTML file in zope
+---[ sujitha mary ]-- | Hi, | | I need to open and display an HTML file in zope.For that I uploaded the file as | DTML document and tried to retrieve it from a page template.this is code which | i wrote for this: | pre | span tal:condition=python:n=='geneprot' tal:replace=here/PH226this | will |/span/pre | 'PH226' is the name of my uploaded file. | If i need to display more than one file at a time wht should i do?i tried to | modify my code for displaying the files which is selected by the user thru' a | form.But it didn't work: | This is the piece of code which i used | span tal:define=x request/phageid | pre | span tal:condition=python:n=='geneprot' tal:replace=here/xthis will | /span/pre/span span tal:replace=python getattr(context, request['phageid']) / OR if you have them stored in a list called pageids; span tal:repeat='pageid request/pageids' span tal:replace=python getattr(context, pageid) / /span -- Andrew Milton [EMAIL PROTECTED] ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )