Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Quotation Marks ...
Hi,
I’ve been trying to write a link using adi_link.
<txp:adi_link url="<txp:site_url />" urlvars="direction=0&offset='<txp:variable name="offset" />'" />
Which doesn’t work because of the use of this quotation mark “offset
Is there a third style of quotation mark I can use to get around this?
Thanks
Geoff
There are 10 types of people in the world: those who understand binary, and those who don’t.
Offline
Re: Quotation Marks ...
Does this work:
<txp:adi_link url="<txp:site_url />" urlvars='direction=0&offset=<txp:variable name="offset" />' />
?
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: Quotation Marks ...
Works perfectly Stef – thank you.
I thought (wrongly) that if you had a second <txp:tag /> embedded in another <txp:tag /> it had to be wrapped in ‘…’ quotes.
Hence my original
<txp:adi_link url="<txp:site_url />" urlvars="direction=0&offset='<txp:variable name="offset" />'" />
Cheers Stef
There are 10 types of people in the world: those who understand binary, and those who don’t.
Offline
Re: Quotation Marks ...
geoff777 wrote:
Works perfectly Stef – thank you.
Cool.
I thought (wrongly) that if you had a second <txp:tag /> embedded in another <txp:tag /> it had to be wrapped in ‘…’ quotes.
You thought rightly in the first place! You do indeed have to have single quotes round an embedded txp:tag if you want it to be parsed as a tag. The difference with the version I posted is that the single quotes are round the entire urlvars
attribute. Thus everything inside it is parsed, and it alleviates the need for a third set of quotes which, as you found, makes things trickier. Depending on the rest of the content this might parse a few microns slower than trying to do what you did originally, but it’s negligible compared to retaining your sanity :-)
fwiw, this can also be used to good effect if you want more than one tag to be parsed in a single attribute, e.g.
<txp:adi_link url='<txp:site_url /><txp:section />' />
Check out Textbook on the subject if you want some more zany examples.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Pages: 1