[Zope] Showing html files
Jaroslav Lukesh
lsh@wo.cz
Tue, 16 Jul 2002 14:20:41 +0200
----------
Odes=EDlatel: andre <zope@bkinformatik.dk>
I'm quite new to zope, and have a little question. I have some html files
in=20
different sub-folders I want to show. In the parent folder I have made a=20
index_html to show a list of the files. The thing is that I want to show
them=20
including a header and a footer. I can't change the html-files, and the
files=20
is uploaded by users, so it has to be a dynamic solution. I hope someone
can=20
help me.
----------
Im quite new too, but I have different complette solution via STX. Many
very advanced users was help me in last weeks, so let take a look to
archive with my name and look to threads. There is maybe a future product
for mid-sized collaborative webs (hundreds of pages).
So I have files in folders as basic structure of the web. Each menu item =
is
separate folder. If in folder is index.htm, then is fully rendered alone
without footer and header. On opposite case is files rendered as segments=
,
regardless if it is HTML formatted (without <html><head>etc tags) or STX
(structured text) document. Segments are sorted via his ID and should be
temporary hidden via property HIDE. Note that if you want add picture to
STX segment, use segment_name.gif as name of picture, picture then will b=
e
displayed right from text of current segment.
Print format was obtain via www.site.com/path/document/print
I hope that these info will be very usefull not only for you and will sav=
e
many hours. I am very happy, that WORKS!
Best regards J. Lukesh
/siteroot
+index_htm
+header and footer with generated menu
+sys_list-item
+print
+navi_BANNER
/folder1
+file1.htm
+file2
+file2.gif
/folder2
+file1
+file1.gif
/folder21
+index.htm
/folder3
+file1
+file2
...etc
DTML Methods are here:
----8<-------------8<-------------8<-------------8<----
/index_html:
<dtml-if "_.hasattr(aq_explicit,'index.htm')">
<dtml-var index.htm>
<dtml-else>
<dtml-var standard_html_header>
<dtml-var sys_list-item>
<dtml-var standard_html_footer>
</dtml-if>
----8<-------------8<-------------8<-------------8<----
/sys_list-item:
<dtml-in expr=3D"objectValues('DTML Document')" sort=3Did>
<dtml-if "hasProperty('hide')"><dtml-else>
<table border=3D"0" width=3D"100%" cellspacing=3D"0" cellpadding=3D"0">
<tr>
<td width=3D"100%">
<h3><dtml-var navi_BANNER></h3>
<dtml-var sequence-item fmt=3Dstructured-text>
</td>
<dtml-try>
<td>
<dtml-var expr=3D"_[id()+'.gif']">
<dtml-except>
</td>
</dtml-try>
</tr>
</table>
</dtml-if>
</dtml-in>
----8<-------------8<-------------8<-------------8<----
/navi_BANNER:
<dtml-if "hasProperty('dlouhy')"
><dtml-var dlouhy
><dtml-else
><dtml-var title
></dtml-if>
----8<-------------8<-------------8<-------------8<----
/print:
<dtml-if "_.hasattr(aq_explicit,'index.htm')">
<dtml-var index.htm>
<dtml-else>
<html><head><title><dtml-var title_or_id></title></head><body>
<dtml-var sys_list-item>
</body></html>
</dtml-if>=20
----8<-------------8<-------------8<-------------8<----