[albatross-users] Dynamic question

Dave Cole djc at object-craft.com.au
Wed Oct 30 10:36:29 EST 2002


> > If I wanted the "whatever" to be different depending on a value in
> > my Python program, is that possible ?
> 
> Yes and no.  You can't be fully dynamic but you can get close.
> 
>   <al-value name="expand_this" lookup="macro_table">
> 
> Then have a lookup table which looks like this:
> 
>   <al-lookup name="macro_table">
>    <al-item expr="this">
>     <al-expand name="this"/>
>    </al-item>
>    <al-item expr="that">
>     <al-expand name="that"/>
>    </al-item>
>   </al-lookup>
> 
> To use this in your code you would just set ctx.locals.expand_this to
> either 'this or 'that'.

Oops - slight problem in the lookup...  The expr attribute in
<al-item> must be a literal string.

  <al-lookup name="macro_table">
   <al-item expr="'this'">
    <al-expand name="this"/>
   </al-item>
   <al-item expr="'that'">
    <al-expand name="that"/>
   </al-item>
  </al-lookup>

- Dave

-- 
http://www.object-craft.com.au




More information about the Albatross-users mailing list