Tridion Dreamweaver Template Delimiter Escaping

This was a question that popped up in the forums recently, so I thought I would share on how to escape Dreamweaver delimiters. That is, actually outputting “@@someValue@@” or “${someValue}” in your DWT’s without having them parsed.

The following samples will all escape the delimiters properly.

@@"@" + "@" + "test" + "@" + "@"@@
@@"$" + "{" + "test" + "}"@@
@@"@" + "@test@" + "@"@@
@@"$" + "{test}"@@

And will output:

@@test@@
${test}
@@test@@
${test}

As a side note, trying to escape the delimiters using the “${ }” delimiter will not work the same. The closest I got to actually displaying the correct output was by using ${"$" + "{" +"test}}. Yep, the odd number of quotes was needed… if you add the last quote (as it looks like it should need), it’ll actually output the last quote. Odd, no?

I hope that helps anyone who’s in need to do this sort of escaping from their DWT’s!

2 thoughts on “Tridion Dreamweaver Template Delimiter Escaping

  1. What if you wanted to escape a more complicated expression like the following:

    Would something like the following work?:

    • Oh, escaping jsp tags, that’s irritating.

      This is the expression from my example:
      <c:set var=”variable” value=”${!empty params.id}” /%gt;

      This is my guessed at solution:
      <c:set var=”variable” value=’@@”$” + “{!empty params.id}”@@’ /%gt;

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>