[ZDP] updating ZDP General news to news classes of Maik

Maik Roeder roeder@berg.net
Thu, 13 Jan 2000 00:14:50 +0100


Hi Tom !


> 2. The news items are now displayed on html basis... this means now that
> I've to put everyware <p>, <br> tags. Is it possible to change the news
> class in such a way that both displays are possible? (Eg without <html>
> tags and one with <html> tag? This without overriding the news class
> everytime!
> 
> Possible with an extra property in the News Class ie. if property is 'html'
> the n show it like an html, if property is 'stx' then show it as structured
> text etc?

I have added a property content_type to DocumentFolder with possible values:
html and stx (The default is html.)
This is going to be rendered by the "Main" method of DocumentFolder.
The changes to Main are minimal:

<dtml-if  "'content' in objectIds(['DTML Method'])">
   <dtml-if "content_type=='html'">
     <dtml-var content>
   <dtml-elif "content_type=='stx'">
     <dtml-var content fmt=structured-text>
   </dtml-if>
</dtml-if>

The constructor and the input form of News will have to be extended to
allow choosing between html and stx.

I did not have to change the default ListNewsFlat method of
NewsFolder to profit from the new behaviour of DocumentFolder
because ListNewsFlat includes the Main method of News, which is
just the Main inherited from DocumentFolder:

<UL>
   <dtml-in rev>
      <LI><B><dtml-var name></B>
      <BR><dtml-var Main>
   </dtml-in>
</UL>

How do you use this with NewsFolder ?

In your List method, just use the Main method and everything else
will be catered for by DocumentFolder.

Greetings,

Maik