SV: [ZPT] page layout by "including" objects

Magnus Heino (Rivermen) magnus.heino@rivermen.se
Wed, 8 Aug 2001 07:19:49 +0200


> ZPT 'randomquote':
> 
> <metal:div define-macro="quote">
>   <tal:div define="here 
> python:whrandom.choice(root.Quotes.objectValues())">
>   <metal:div 
> use-macro="root/Quotes/view/macros/viewquote">Random Quote
> Table</metal:div>
>   </tal:div>
> </metal:div>
> 
> Q: Is it safe to redefine 'here' in the div block?

Though I don't see the need for doing it, I guess it should be safe in the
example above.

> Did I miss anything?  I suppose I could combine the two macros for
> effeciency, but it should work either way.

<div metal:define-macro="quote">
  <table>
    <tr>
      <td
tal:content="python:whrandom.choice(root.Quotes.objectValues())">Quote</td>
    </tr>
  </table>
</div>

/Magnus