[Zope] (no subject)

Jay, Dylan djay@lucent.com
Tue, 27 Jun 2000 10:43:20 +1000


> -----Original Message-----
> From: Marco Mariani [mailto:m.mariani@imola.nettuno.it]
> Sent: Monday, June 26, 2000 6:39 PM
> To: Jay, Dylan
> Subject: Re: [Zope] (no subject)
> 
> 
> On Mon, Jun 26, 2000 at 02:56:39PM +1000, Jay, Dylan wrote:
> 
> > > <dtml-if X>
> > >    <a href="a_url">
> > >    link text
> > >    </a>
> > > <dtml-else>
> > >    link text
> > >    (no link...)
> > > </dtml-if>
> > 
> > yes but the repitition of "link text" could be a real pain 
> if "link_text" is
> > big. Repitition is always a maintance nightmare.
> 
> So is dtml-always.

No thats not the same thing. If I have a complex expression for X and it
needs to be changed then it will have to be changed in two places. If I
forget to update it in both places I would create a bug. My proposal
elegently avoids this problem.


> 
> > > <dtml-var "['<A HREF=....>',''][not X]">
> > >    link text
> > > <dtml-var "['</A>','(no link...)'][not X]">
> > 
> > I've no idea about this syntax. Does it work?
> 
> Yes it does. "not X" is the array index, 0 or 1.

oic. Thats nasty. Actually you can just write that <dtml-var "not X and '<A
HREF=....>'"> which is a bit cleaner.

 
> 
> -- 
> "This company has performed an illegal operation and will be 
> shut down.
>  If the problem persists, contact your vendor or appeal to a 
> higher court."
>  - Signal11 on slashdot
>