W3C
Is there an operator able to encode a string for W3C valide href attribute?
For example, in the base link.tpl, we can read:
<a href="{$node.data_map.location.content}">
Every contributor will type a non encoded URL with amperstamp. So the template should replace & by & to have valid HTML. This is not the case. And exturl() won't help.
What is the aim of exturl? Only add doublequotes??
Comments (4 historical)
Written by readers of the earlier documentation sites, kept as they were.
Re: W3C
Adrien ·
ezurl can be used on external URL too:
<a href="{$node.data_map.location.content|ezurl()}">
This is the way to have W3C valid href attributes.
Re: Re: W3C
marcin ·
But still can't be used to encode url, to pass url as a parameter. And i havn't found good way to do this.
Re: Re: Re: W3C
Adrien ·
True. {'http://test.com?p1=v1&p2=v2'|ezurl('no')} doesn't produce the expected &.
Re: Re: Re: Re: W3C
Andi ·
"wash" is the way to go:
{"Tom & Jerry "|wash} {* Tom & Jerry *}