[albatross-users] Macro and links?

Cameron Blackwood korg at darkqueen.org
Thu Aug 14 14:07:17 EST 2003


Macros and other <al-tags>
--------------------------

OK, maybe my doc reading skills suck, but can someone tell me how to
make this work?

---------------- 8< begin
import albatross

ctx = albatross.SimpleContext('.')

albatross.Template(ctx, '<magic>', '''
<al-macro name="test">
value:<al-usearg name="arg1">
remove button: <al-input type="text" name="remove" expr="arg1">
</al-macro>
''').to_html(ctx)

ctx.flush_content()

albatross.Template(ctx, '<magic>', '''
Output:
<al-expand name="test"><al-setarg name="arg1">value</al-setarg></al-expand>
:output
''').to_html(ctx)

ctx.flush_content()

---------------- 8< end

I have a list of things and I want a macro to print the value with a
'remove' button at the end.

I cant see how to access the macro argument from an al-input (or how
I'd do this with an unnamed arguement, but thats another story).

Isnt adding other al-tags something that should be 'easy' in a macro,
or am I doing something totally dumb here.

If Im on the wrong track here then can someone hint at what I should
be doing to display the items like I want (pagination would be nice,
but Id rather actually get the thing working first ;)



Doc error
---------
More missing 'src="' stuff:
http://www.object-craft.com.au/projects/albatross/albatross/app-popview2.html
contains:
<al-input type="image" name="detail" srcicons/generic.gif" border="0">


--
 / `Rev Dr'   cam  at darkqueen.org            Roleplaying, virtual goth \
<   http://darkqueen.org        Poly, *nix, Python, C/C++, genetics, ATM  >
 \  [+61 3] 9809 1523[h]         skeptic, Evil GM(tm). Sysadmin for hire /
                      ---------- Random Quote ----------
You should go home.



More information about the Albatross-users mailing list