Search code examples
tridiontridion-content-delivery

What's the correct format for TCDL linkAttributes?


I can see the technology-independent Tridion Content Delivery Language (TCDL) link has the following parameters, which are pretty well described on SDL Live Content.

  • type
  • origin
  • destination
  • templateURI
  • linkAttributes
  • textOnFail
  • addAnchor
  • VariantId

How do we add multiple attribute-value pairs for the linkAttributes? Specifically, what do we use to escape the double quotes as well as separate pairs (e.g. if we need class="someclass" and onclick="someevent").


Solution

  • The separate pairs are just space delimited, like a normal series of attributes. Try XML encoding the value of linkAttributes however. So, " become &quote;, etc...

    If you are using some Javascript, you might take care of the Javascript quotes too, as in \".