[Petal] Creating a mailto href tag
Jean-Michel Hiver
jhiver@mkdoc.com
Fri, 26 Jul 2002 12:06:08 +0100
On Thu 25-Jul-2002 at 04:59:08PM -0400, William McKee wrote:
> I'm hoping for some input on a better way to create a mailto href. I'm passing in an
> email address to my script which I want to make into a mailto href. It seems the
> easiest format would be:
>
> <a petal:content="email" petal:attr="href mailto:email">email</a>
>
> However, I doubt that would work (although I haven't actually tried it, though) and
> have resorted to the following format:
>
> <a petal:content="email" href="mailto:<?petal:var name="email"?>">email</a>
>
> Perhaps I need to build a :href modifier... Just looking for some ideas.
Your problem here is that the TAL concept makes it very hard (if not
impossible) to concatenate string. I suspect that
<a petal:content="email" href="mailto:<?petal:var name="email"?>">email</a>
Is going to make a lot of WYSIWYG editors very upset. But in this case
you can be saved by the magical dollar :+) So what I'd do would be:
<a petal:content="email" href="mailto:$email">someone@foo.com</a>
Which should work, unless there's a bug :-)
Cheers,
--
IT'S TIME FOR A DIFFERENT KIND OF WEB
================================================================
Jean-Michel Hiver - Software Director
jhiver@mkdoc.com
+44 (0)114 255 8097
================================================================
VISIT HTTP://WWW.MKDOC.COM