[Zope] Showing html files

andre zope@bkinformatik.dk
Tue, 16 Jul 2002 12:57:15 +0200 (CEST)


Thank's alot, but how do i include a DTML-document object for printing in 
python??

Jens

Citat peter sabaini <sabaini@inode.at>:

> hmm... if your files are NOT complete html files but rather fragments 
> (ie. without leading &lt;html&gt; &lt;/html&gt; tags etc.) then thats 
> easy -- one possibility would be something like the script below 
> (uncomment according to your needs). this should be called like for 
> instance:
> 
> href="folder_your_files_are_in/embed_py?id=filename_in_folder"
> 
> ## Script (Python) "embed_py"
> ##bind container=container
> ##bind context=context
> ##bind namespace=
> ##bind script=script
> ##bind subpath=traverse_subpath
> ##parameters=id
> ##title=
> print "<html>header"      # or include another zope object
> o = getattr(context, id)
> # if the files are dtml methods call them:
> # print o(client=context, REQUEST=context.REQUEST)
> # else just print:
> # print o
> print "\nfooter</html>"
> return printed
> 
> if your html files are complete you should strip the html header etc. 
> out before prepending your own header
> 
> hth peter.
> 
> andre wrote:
> > Hi
> > 
> >  
> > 
> > I'm quite new to zope, and have a little question. I have some html
> files in 
> > different sub-folders I want to show. In the parent folder I have made
> a 
> > index_html to show a list of the files. The thing is that I want to
> show them 
> > including a header and a footer. I can't change the html-files, and
> the files 
> > is uploaded by users, so it has to be a dynamic solution. I hope
> someone can 
> > help me.
> > 
> >  
> > 
> > Thank's in advance
> > 
> >  
> > 
> > Jens Bjerre
> > 
> > 
> > _______________________________________________
> > Zope maillist  -  Zope@zope.org
> > http://lists.zope.org/mailman/listinfo/zope
> > **   No cross posts or HTML encoding!  **
> > (Related lists - 
> >  http://lists.zope.org/mailman/listinfo/zope-announce
> >  http://lists.zope.org/mailman/listinfo/zope-dev )
> > 
> > 
> 
>