[Zope] (no subject)

Bill Anderson bill@libc.org
Mon, 26 Jun 2000 02:13:39 -0600


"Jay, Dylan" wrote:
> 
> > -----Original Message-----
> > From: Marco Mariani [mailto:m.mariani@imola.nettuno.it]
> > Sent: Friday, June 23, 2000 9:54 PM
> > To: Jay, Dylan; zope@zope.org
> > Subject: Re: [Zope] (no subject)
> >
> >
> > On Fri, Jun 23, 2000 at 04:32:39PM +1000, Jay, Dylan wrote:
> >
> > > It seems to me that a few tweaks to the dtml-if syntax
> > would be beneficial
> > >
> > > something like the following would certainly clean up some
> > of the logic I
> > > end up writing.
> > >
> > > <dtml-if X>
> > >  <a href="a_url">
> > > <dtml-always>
> > >  link text
> > > <dtml-else>
> > >  (no link currently available)
> > > <dtml-then>
> > >  </a>
> > > </dtml-if>
> >
> > <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.


If it is, make it a method or attribute.

<dtml-if X>
   <a href="a_url"> <dtml-var linktext></a>
<dtml-else>
   <dtml-var linkText> (No Link Available)
</dtml-if X>

You could make the links objects, such that:
<dtml-in "objectValues('Link Object')">
  <br> <a href="<dtml-var linkURL>" <dtml-var linkText> </a>
<dtml-else>
  <p> Sorry, no links available at this time.
</dtml-if Link Objects>

The real question is why have link text that doesn't link... ;)