[Zope] Wrapping zope header/footer around LocalFS html objects
Pieter Biemond
biemond@mxi.nl
Fri, 2 Mar 2001 19:20:06 +0100
Hello,
Today I installed the LocalFS-product and would really like to use it to
wrap/zopify (local) html-files on a Zope-site. That is: see a HTML-file with
the Zope standard_html_header and standard_html_footer attached. I read the
LocalFS-FAQ at http://www.zope.org/Members/jfarr/HowTo/DTML_with_LocalFS
and tried the following dtml-document:
<dtml-var standard_html_header>
<dtml-var "localfsdir['somefile.html'].data">
<dtml-var standard_html_footer>
Unfortuately it doesn't work. Can anybody tell me why?
Furthermore, I really would like to be able to render a lot of HTML-files
this way (and extract the TITLE and BODY tags if possible). Did anybody do
this before?
I found a bit of Python code that should be able to extract the body-tag,
but I am clueless how to get it to work using LocalFS.
page = <<somehowreferencethelocalfsobject>>.data
regex = re.compile(r'<body.*?>(.*?)</body>', re.I | re.M | re.S)
result = regex.search(page)
if result:
return result.group(1)
else
return "no body tag found"
Any help would be appreciated,
Pieter Biemond
PS I also tried using DocBrowser, but can't get it do to what I want either.