[Zope-CMF] Compound elements status
Chris Withers
chrisw@nipltd.com
Fri, 29 Mar 2002 17:07:16 +0000
seb bacon wrote:
>
> When you display a page with its 'view' action, you want to display each
> of its components according to their 'view' action. How about if you
> have a 'view comments' action for a page, which puts some copy at the
> top regarding comment threads, and then displays each component with its
> thread beneath. Then you need a way to map between the container's
> action and those of its components. This can only be done in a 'slot'
> type definition.
Huh? Ya lost me... take it slow... I suspect it may not be necessary ;-)
> Also, if you have slots with named components, you get to define the
> layout of the page accurately ('image_1 goes here, text_3 goes there'),
> which it is hard to do when the components are looped over in a repeat
> clause. Of course you could extend the interface with CMFArticle to
> allow you to name elements; however, the user would then need access to
> the page layout source too.
Urm, ZPT is a pretty good templating language. I don't see why whoever needs to
lay out a page can't do it with a simple ZPT:
<table>
<tr>
<td tal:content="here/element1" colspan="2"></td>
</tr>
<tr>
<td tal:content="here/element2"></td>
<td tal:content="here/element3"></td>
</tr>
?
> A separate design consideration is that it would be nice to be able to
> recursively compose components. What I mean by this is the following:
> suppose you have a type which has two fixed slots, "image" and "text".
> These are displayed in the default action with the text on the left and
> image on the right. Wouldn't it be nice to be able to add these two
> elements as a single "textandimage" component to another template?
Yup, but I don't really see why you need slots for this?
> Another consideration is that it would be nice to be able to use any
> existing Types as components without having to tinker with their source
> code: it should be possible to create new 'articles' (I call them
> 'templates') through the web.
...indeed. But I don't see how you're gonna lay out a page properly without
writing some HTML, and if ya gonna do that, why not use a ZPT?
cheers,
Chris