AW: [Zope-CMF] How to "import" only content without header/ footer

Jens Hauser hauser at pilsgenuss.de
Tue Mar 8 13:23:33 EST 2005


Hi,
 
I fixed the problem by myself - took me about three hours (d*mn
documentation). If somebody is interested how it works, here is a code
snippet from a dtml method, which does what I want. I call it from a
different dtml-document with <dtml-var concat_content>
 
####CUT
<!-- Diese Methode zeigt die Inhalte aller Dokumente im aktuellen
Verzeichnis an -->
 
<dtml-let upObject="this().aq_parent" upTitle="this().aq_parent.title">
 
<dtml-with upObject>
  <dtml-in expr="objectValues( [ 'Document' ] )" 
           sort=id skip_unauthorized>
    <dtml-if expr="id <> 'allgemeines' and id <> 'img' and id <> 'pdf' and
id <> 'aktuelles'">
      <dtml-with sequence-item>
        <dtml-var "this().content.text"><br>
      </dtml-with>
    </dtml-if>
  </dtml-in>
</dtml-with>
 
</dtml-let>
####CUT
 
The important part is this one:
 
      <dtml-with sequence-item>
        <dtml-var "this().content.text"><br>
      </dtml-with>

Regards,
Jens
 


  _____  

Von: zope-cmf-bounces at lists.zope.org
[mailto:zope-cmf-bounces at lists.zope.org] Im Auftrag von Jens Hauser
Gesendet: Dienstag, 8. März 2005 11:15
An: zope-cmf at zope.org
Betreff: [Zope-CMF] How to "import" only content without header/ footer


Hi,
 
I'm trying to create a dtml-document, which concats all content from all
documents within a folder. Sadly for all objects the standard_html_header
and footer is added. I'd like to strip these information and show only the
content of each found document. Therefore I wrote the following script:
 
###CUT
<dtml-var standard_html_header>
<dtml-let folder_url=absolute_url>
<p>
<dtml-let upObject="this().aq_parent" upTitle="this().aq_parent.title">
 
<h2><dtml-var upTitle></h2>
 
<dtml-with upObject>
    <dtml-in expr="objectValues( [ 'Document' ] )" 
      sort=id skip_unauthorized>
      <dtml-if expr="id <> 'allgemeines' and id <> 'img' and id <> 'pdf' and
id <> 'aktuelles'">
<dtml-with "_.namespace(standard_html_header='',
                        standard_html_footer='')">
<dtml-call "REQUEST.set('renderedheader',1)">
<dtml-call "REQUEST.set('renderedfooter',1)">
<dtml-var sequence-item>
</dtml-with>
     </dtml-if>
    </dtml-in>
</dtml-with>
</dtml-let>
</p>
<dtml-call "REQUEST.set('renderedfooter',0)">
 
</dtml-let>
<dtml-var standard_html_footer>

###CUT
 
Both methods which I found googling do not work (<dtml-with
"_.namespace(standard_html_header='',
                        standard_html_footer='')">
and <dtml-call "REQUEST.set('renderedheader',1)">)

What can I do to remove the header and footer for each document?
 
Best regards,
Jens Hauser
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope-cmf/attachments/20050308/851a0b6b/attachment.htm


More information about the Zope-CMF mailing list