[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: define-container, preserve and -Dvarname

On Wed, 11 Aug 1999, Davor Cengija wrote:

> 	I have a <define-container> tag which can have three values for an
> 	attribute: first is the default, hardcoded; the second is per-page
> 	default, called with -D option in #!wml -Dvarname=value and the third one is the
> 	specified value for each call.
[snip long description of this problem]

Hi Davor,

i don't have time to investigate too much your problem, sorry, but i'm
sure there is a solution. Did you have a close look at the wml_p1_ipp
manpage ?

Below is an example, i'm sure you can easily adapt it to your own needs:
(not tested, may contain bugs)

<define-container tbl>
<preserve bgcolor>
<preserve title>
<set-var %attributes>
#  this variable will be ``red'' if no -Dbgcolor attribute is set,
#  otherwise it takes this value.
<ifeq "<get-var bgcolor>" "" <set-var bgcolor="$(bgcolor:-red)">>
#  everything below is unchanged
<ifeq "<get-var title>" "" <set-var title="YOU MUST HAVE A TITLE!!">>
<table width="220" cellspacing="0" cellpadding="1" border="0" \
bgcolor="<get-var bgcolor>">
<table width="100%" \
cellspacing="0" cellpadding="2" border="0">
<th><get-var title></th>
<td bgcolor="white">
<restore bgcolor>
<restore title>


Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com