[Zope] Building multiple documents from fragments(objects).

Casey Duncan cduncan@kaivo.com
Wed, 04 Apr 2001 10:31:34 -0600


Alan Young wrote:
> 
> Hello All,
> 
> I have some newbie questions.
> 
> I'm an experienced perl programmer trying to learn Zope/Python and am
> trying to do something I know must be possible, but am having a hard
> time wrapping my brain around this new way of doing things.
> 
[snip]
> 
> Is there a way that I can do something like this (warning: It's a clunky
> mix of perl and dtml):
> 
> for my $f ( qw( fragment1 fragment2 fragment3 ) ) {
>     <div><h3><dtml-var $f-title</h3>
>         <ul>
>             <li><dtml-var $f></li>
>         </ul>
>     </div>
> }
> 
> I would prefer to do this entirely in dtml if at all possible (I need to
> show non-programmers how to do this if I can make it work and they don't
> wanna know about Python or Perl stuff).
> 
> Failing that, is there a way I can do this generically enough that a
> designer could just use a dtml tag and pass the necessary values?
> 
> Thanks for your input.
> 
> Alan

Assuming they are DTML documents (if not, substitute your fragment
object meta type) here is the DTML:

<dtml-in expr="docs.objectValues('DTML Document')">
    <div><h3><dtml-var name="title_or_id"></h3>
        <ul>
            <li><dtml-var name="sequence-item"></li>
        </ul>
    </div>
</dtml-in>

-- 
| Casey Duncan
| Kaivo, Inc.
| cduncan@kaivo.com
`------------------>