Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Java Unified Expression Language uses the same ${...} syntax as SDL Tridion Template Expression Language. Work around this by writing your JUEL as $[...] in your Dreamweaver TBBs and use this TBB in your page template to convert the resultant output.

View ConvertOutputToJavaUnifiedExpressionLanguage.cs
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
using System.Text.RegularExpressions;
using Tridion.ContentManager.Templating;
using Tridion.ContentManager.Templating.Assembly;
 
namespace SDLTridion.Templating.Example
{
/// <summary>
/// Java Unified Expression Language uses the same ${...} syntax as
/// SDL Tridion Template Expression Language. Work around this by
/// writing your JUEL as $[...] in your Dreamweaver TBBs and use this
/// TBB in your page template to convert the resultant output.
/// </summary>
[TcmTemplateTitle("Convert Output to Java Unified Expression Language")]
class ConvertOutputToJavaUnifiedExpressionLanguage : ITemplate
{
public void Transform(Engine engine, Package package)
{
Item outputItem = package.GetByName(Package.OutputName);
 
string output = outputItem.GetAsString();
 
output = Regex.Replace(output, @"\$\[(.*?)\]", @"${$1}");
 
outputItem.SetAsString(output);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.