[albatross-users] Trouble with custom tag

Michael Neel neel at mediapulse.com
Tue Dec 30 14:38:52 EST 2003


Okay, I'm an idiot, I look right past the push/pop content trap
functions.  All I needed was is this:


    def to_html(self, ctx):
        ctx.push_content_trap()
        self.flash.to_html(ctx)
        flash = ctx.pop_content_trap()

        ctx.push_content_trap()
        self.noflash.to_html(ctx)
        noflash = ctx.pop_content_trap()

        ctx.write_content(flash)

Mike

-----Original Message-----
From: gnb at itga.com.au [mailto:gnb at itga.com.au] 
Sent: Sunday, December 28, 2003 10:47 PM
To: Michael C. Neel
Cc: albatross-users at object-craft.com.au
Subject: Re: [albatross-users] Trouble with custom tag 


This is the code I use in one of my custom tag classes, to do the
Albatross
macro expansion in the "desc" string if needed:

            if desc.find("<al") >= 0:
                ctx.push_content_trap()
                Template(ctx, '<magic>', desc).to_html(ctx)
                desc = ctx.pop_content_trap()

>From memory, I grabbed this from some of the supplied Albatross tags.





More information about the Albatross-users mailing list