Skip to the content
Documentation

W3C

No ratings yet

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 &amp; 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.

  1. 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.

    1. 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.

        1. Re: Re: Re: Re: W3C

          Andi ·

          "wash" is the way to go:
          {"Tom & Jerry "|wash} {* Tom &amp; Jerry *}