Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
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__
Offline
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
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__
Offline
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
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
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__
Offline
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__
Offline
Pages: 1