[Zope] Re: Filling a metal slot which name is known only at run time

Martin Aspeli optilude at gmx.net
Tue Dec 14 14:09:47 EST 2004


On Tue, 14 Dec 2004 12:46:49 -0600, Evan Simpson <evan at tokenexchange.com>  
wrote:

> Martin Aspeli wrote:
>> When viewing the CompositePage, it will do the following:
>>  <metal:layout use-macro="here/getChosenLayoutTemplate">
>>     <metal:composite fill-slot="top_slot">
>>         <div tal:content="structure python:here.renderContentForSlot   
>> ('top_slot')"/>
>>     </metal:composite>
>>     <metal:composite fill-slot="bottom_slot">
>>         <div tal:content="structure python:here.renderContentForSlot   
>> ('bottom_slot')"/>
>>     </metal:composite>
>> </metal:layout>
>
> Ah, so you want layout template authors to be able to define slots with  
> semi-meaningful names, then programmatically fill those slots with  
> either a content-selector widget or the selected content.  The fact that  
> 'fill-slot' only accepts a literal string isn't a surface detail --  
> you'd have to go deep into the guts of the TAL interpreter to change  
> that. The best way I can think of to deal with this is to actually  
> generate the ZPT text with the slot names filled in, as in the example  
> above, and compile the text as a template.

Interesting... How can I do that (compile + execute as a template)?

Martin

-- 
"Life is both a major and a minor key" -- Travis, Side



More information about the Zope mailing list