Mailing List Archive

[Zope-PTK] STX_Document
Hi !

> This sounds like something people would like. I agree that this is really,
> really simple. But, I've seen people coming from Frontierland and wondering
> why they need to include <dtml-var standard_html_header> when Frontier
> automatically includes headers and footers...

The index_html resides in the ZClass, so <dtml-var standard_html_header>
is already included automatically. People won't see the inclusion.

> An STX_Document class is also useful because otherwise you need to make a
> separate method to render the doc out to HTML, which seems a little hokey.

Why not use a simple Document ZClass and, given a property content_type
of html, stx or txt call the following from index_html ? (Could also be
done via subclassing from generic Document ZClass).

<dtml-if "content_type=='html'">
<dtml-var content>
<dtml-elif "content_type=='stx'">
<dtml-var content fmt=structured-text>
<dtml-elif "content_type=='txt'">
<dtml-var content html_quote newline_to_br>
</dtml-if>

Greetings,

Maik Röder
Re: [Zope-PTK] STX_Document [ In reply to ]
FWIW, we know that we should overhaul the concept of documents in Zope.
Michel Pelletier started a thread about "multi-format documents" on the
Zope list about four months ago.

Consider the work on PTK to be experimentation with various ideas for
future Zope releases.

--Paul

Maik Roeder wrote:
>
> Hi !
>
> > This sounds like something people would like. I agree that this is really,
> > really simple. But, I've seen people coming from Frontierland and wondering
> > why they need to include <dtml-var standard_html_header> when Frontier
> > automatically includes headers and footers...
>
> The index_html resides in the ZClass, so <dtml-var standard_html_header>
> is already included automatically. People won't see the inclusion.
>
> > An STX_Document class is also useful because otherwise you need to make a
> > separate method to render the doc out to HTML, which seems a little hokey.
>
> Why not use a simple Document ZClass and, given a property content_type
> of html, stx or txt call the following from index_html ? (Could also be
> done via subclassing from generic Document ZClass).
>
> <dtml-if "content_type=='html'">
> <dtml-var content>
> <dtml-elif "content_type=='stx'">
> <dtml-var content fmt=structured-text>
> <dtml-elif "content_type=='txt'">
> <dtml-var content html_quote newline_to_br>
> </dtml-if>
>
> Greetings,
>
> Maik Röder
>
> _______________________________________________
> Zope-PTK maillist - Zope-PTK@zope.org
> http://lists.zope.org/mailman/listinfo/zope-ptk