Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-10-01 18:00:39

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Is there a way to use txp:email without generating a link?

I want to use txp:email to obfuscate an eMail address (grabbed from a txp:variable), but since this will be presented as the content of a <link rel="author" element in the document head. Is there any way to make txp:email output the encoded eMail address only, without an anchor element? Or is there another way you would recommend?

Thanks!

Offline

#2 2009-10-01 18:04:50

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Is there a way to use txp:email without generating a link?

johnstephens wrote:

Is there any way to make txp:email output the encoded eMail address only, without an anchor element?

No, it always produces a link.

Or is there another way you would recommend?

Easy to hack it or make a plugin giving you that option. There might be a plugin — have you looked?


Code is topiary

Offline

#3 2009-10-01 18:10:44

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Is there a way to use txp:email without generating a link?

Thanks for the swift reply, Jeff!

I didn’t look for a plugin before posting, because I thought there might be a native way to do this. I check Textpattern Resources and found a bunch of options. So far, none of them do what I want, but I’ll pore over them. Thanks again.

Offline

#4 2009-10-01 18:14:57

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Is there a way to use txp:email without generating a link?

I can’t find one that doesn’t depend on javascript or generate unnecessary markup (yab_email comes the closest, but it generates a span element, which is invalid in the context). Would there be an easy txp:php solution to this?

Offline

#5 2009-10-01 18:50:30

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Is there a way to use txp:email without generating a link?

johnstephens wrote:

I can’t find one that doesn’t depend on javascript or generate unnecessary markup (yab_email comes the closest, but it generates a span element, which is invalid in the context). Would there be an easy txp:php solution to this?

Untested: put this in a form:

<txp:php>
echo eE(yield());
</txp:php>

Call the form in output_tag output_form’s container mode, with the email address (in this case the variable) as the tag contents.

Edit: sorry, output_form not output_tag. I tested it and it does work.

Last edited by jsoo (2009-10-01 18:57:05)


Code is topiary

Offline

#6 2009-10-01 19:43:53

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: Is there a way to use txp:email without generating a link?

Thank you again, Mr. Soo! Light, nimble solution, no plugin!

Offline

Board footer

Powered by FluxBB