Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-09-08 13:38:12

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

email value of <txp:email>

Does anyone know how to treat the value of the email parameter in:

<txp:email value="<txp:variable name='cmail' />" linktext="Contact" title="Contact us" />

So that it gets the value of the variable not the plain text value…

Currently it builds:

mailto :<txp:variable name='cmail' />

I need instead:

mailto :jondoe@gmail.com

Kthx !

Last edited by hablablow (2010-09-08 13:39:43)


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

#2 2010-09-08 14:17:22

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

Re: email value of <txp:email>

See the FAQ, Can I use tags within tags? You need to use single quotes around a tag within a tag.


Code is topiary

Offline

#3 2010-09-08 14:55:27

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: email value of <txp:email>

Jeff,

I had checked that before but it’s not working for the email tag.

Thanks for the tip.

Last edited by hablablow (2010-09-08 14:56:54)


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

#4 2010-09-08 15:50:09

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: email value of <txp:email>

hablablow wrote:

I had checked that before but it’s not working for the email tag.

Yes, it should. The parser is universal and the parsing works the same way for every tag. See and bookmark: TextBook / Parsing Tag Attributes

While you have:

<txp:email value="<txp:variable name='cmail' />" />

It should be:

<txp:email email='<txp:variable name="cmail" />' />

For example, the following code:

<txp:variable name="mail" value="john.doe@example.com" />
<txp:email email='<txp:variable name="mail" />' />

Will return:

<a href="mailto:john.doe@example.com">Contact</a>

Everything surrounded with single quotes is parsed.

As far as escaping goes, you can escape double quotes that are inside double quotes using pair of double quotes:

<txp:foo bar="there are ""quotes"" here too" />

Same goes for nested single quotes.

Last edited by Gocom (2010-09-08 15:59:45)

Offline

#5 2010-09-08 16:12:10

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: email value of <txp:email>

Use the right quotes and it’ll work:

<txp:email value='<txp:variable name="cmail" />' linktext="Contact" title="Contact us" />

Offline

#6 2010-09-08 16:26:42

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: email value of <txp:email>

Alright folks thank you very much for your explanations.
It should work now.
Jukka thank you very much for this long and clean explanation.


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

#7 2010-09-09 15:57:37

hablablow
Member
From: Paris
Registered: 2004-12-13
Posts: 309
Website

Re: email value of <txp:email>

So here’s the correct syntax:

<txp:email email='<txp:smd_bio_info items="contactmail" label="" />' />

Single quotes outside, double inside !

8)

Last edited by hablablow (2010-09-09 15:59:24)


_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__

Hablablow + Webdesignofficina

Offline

Board footer

Powered by FluxBB