You are here:   » Home » Documentation » Details » How-To » TOC-Lists » Home

Deliver overview lists per RSS-stream (Content-Syndication)

Author: Dr. Frank Hoffmann, 2003/04/30

A RSS-conform XML file shall be generated out of ZMS objects of a certain content node. For this purpose a new DTML method at the level of the display templates is set up which generates a TOC-list acc. to RSS-DTD (see links below). The mechanism is shown by means of a simple basic structure.

Solution: The following DTML method generates an XML-stream introduced by the RSS-typical channel element. Then comes the definition of the entry node and an iterative listing with the filteredChildNodes function.

<dtml-call expr="RESPONSE.setHeader('content-type', 'text/xml')">
<?xml version="1.0" encoding="iso-8859-1" ?> 
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>

<title>medvalue.news</title>
<description>Aktuelle Themen aus dem medvalue-Netzwerk</description>
<language>de</language>
<link>http://medvalue.net</link>
<copyright>(c)2003 HOFFMANN+LIEBENBERG</copyright>

<!-- beispielhafter Einstiegsknopten content.e83 //-->
<dtml-with "content.e83">
<dtml-in "filteredChildNodes(REQUEST,PAGES,)">
<item>
<title><dtml-var "getTitle(REQUEST)"></title>
<description><dtml-var "getObjProperty('attr_dc_description',REQUEST)"></description>
<link><dtml-var "getHref2IndexHtml(REQUEST)"></link>
<dc:creator><dtml-var "getObjProperty('attr_dc_creator',REQUEST)"></dc:creator>
<dc:date><dtml-var "getLangFmtDate(getObjProperty('change_dt',REQUEST),
'eng','ISO-8601')"></dc:date>  
</item>
</dtml-in>
</dtml-with>

</channel>
</rss>

Comment: [howto@/support/content/e732/e736/e780/e1368][getObjProperty]: key=howto_comment
Traceback (most recent call last):
File "/home/zope/Products/zms/_objattrs.py", line 720, in getObjProperty
value = _globals.dt_html(self,value,REQUEST)
File "/home/zope/Products/zms/_globals.py", line 261, in dt_html
value = dtml( self, REQUEST)
File "/home/zope210/lib/python/DocumentTemplate/DT_String.py", line 476, in __call__
try: result = render_blocks(self._v_blocks, md)
File "/home/zope210/lib/python/DocumentTemplate/DT_With.py", line 60, in render
if type(expr) is type(''): v=md[expr]
KeyError: 'rss_medvalue'

References: