[albatross-users] Problem with Macro Expand/Usearg

Sheila King sheila at thinkspot.net
Sat May 31 08:03:23 EST 2003


ARRRGGG.
Never mind.

It *would* work, if I put the name="js_scripts" attribute and 
name="body_tags" attribute in the set-arg tags.

How embarrassing. I don't know why I didn't see that before, with all the 
staring I did.

-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org


--On Friday, May 30, 2003 2:28 PM -0700 Sheila King <sheila at thinkspot.net> 
wrote:

> I'm having a problem with a Macro, where as far as I can see, I've set
> everything properly, but an arg I've set (actually two out of three) for
> this macro do not get substituted.
>
> I'm baffled.
>
> Here is the page display function:
>
> def page_display(ctx):
>     if ctx.has_value('_errmssg'):
>         ctx.run_template('loginerr.html')
>         ctx.clear_locals()
>         return
>     ctx.load_template('commonmacros.html')
>     ctx.run_template('login.html')
>     authlib.update_session(ctx)
>
> The "commonmacros.html" file contains this macro:
>
> ---------------------------------------------------
> <al-macro name="qaheader">
> <html>
> <head>
> <title><al-usearg name="page_title"></title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <link rel="stylesheet" href="/qa/styles.css" type="text/css">
> <al-usearg="js_scripts">
> </head>
> <body <al-usearg="body_tags"> leftmargin=0 topmargin=0 marginwidth=0
> marginheight=0 bgcolor="#FFFFFF" text="#000000">
> <!-- Top Purple Nav Table -->
> <table width="100%" border="0" cellspacing="0" cellpadding="0"
> height="30">   <tr>
>     <td bgcolor="#8F32B4"><font color="#FFFFFF">
>     [CompanyName] [Help] [About]</font></td>
>   </tr>
> </table>
>
>       <table width="100%" border="0" cellspacing="0" cellpadding="0">
>         <tr>
>           <td align="right"><img src="/qaimg/curve.gif" width="300"
> height="50" align="left" vspace="0" hspace="0"><img
> src="/qaimg/qalogo.gif"  width="200" height="40" vspace="8"
> hspace="5"><img src="/qaimg/fqlogo3.gif"  width="75" height="56"
> vspace="5" hspace="25"></td>
>       </table>
>
> </al-macro>
> ---------------------------------------------------
>
> As you can see, there are three <al-setarg> tags, with names:
>
> page_title
> js_scripts
> body_tags
>
> And here is where the macro is called in the login.html file:
>
> ---------------------------------------------------
> <!-- Begin page header -->
>
> <al-expand name="qaheader">
> <al-setarg name="page_title">Login</al-setarg>
> <al-setarg name="js_scripts"><script language="JavaScript">
> <!-- Hide Me
> function focusField(){
>  var form = window.document.forms[0];
>  form.username.focus();
> }
> // Show Me -->
> </script></al-setarg>
> <al-setarg name="body_tags">onLoad="focusField();" </al-setarg>
> </al-expand>
>
> <!-- End page header -->
> ---------------------------------------------------
>
> So, I am passing all three arguments to the macro. I have studied this
> and I DO have closing tags for everything.
>
> Yet, when I run the page, only the page_title argument gets passed to the
> output. the js_scripts and body_tags arguments do not get touched at all,
> for some reason.
>
> Here is the output HTML page (the portion that applies):
>
> ---------------------------------------------------
> <!-- Begin page header -->
>
> <html>
> <head>
> <title>Login</title>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <link rel="stylesheet" href="/qa/styles.css" type="text/css">
> <al-usearg="js_scripts">
> </head>
> <body ><al-usearg="body_tags"> leftmargin=0 topmargin=0 marginwidth=0
> marginheight=0 bgcolor="#FFFFFF" text="#000000">
> <!-- Top Purple Nav Table -->
> <table width="100%" border="0" cellspacing="0" cellpadding="0"
> height="30">   <tr>
>     <td bgcolor="#8F32B4"><font color="#FFFFFF">
>
>     [CompanyName] [Help] [About]</font></td>
>   </tr>
> </table>
>
>       <table width="100%" border="0" cellspacing="0" cellpadding="0">
>         <tr>
>           <td align="right"><img src="/qaimg/curve.gif" width="300"
> height="50" align="left" vspace="0" hspace="0"><img
> src="/qaimg/qalogo.gif"  width="200" height="40" vspace="8"
> hspace="5"><img src="/qaimg/fqlogo3.gif"  width="75" height="56"
> vspace="5" hspace="25"></td>
>       </table>
>
> <!-- End page header -->
> ---------------------------------------------------
>
> What am I doing wrong? Why won't the macro substitute the last two user
> args?
>
> Thanks for your help,
>





More information about the Albatross-users mailing list