We saw in the previous post how to do a double look-up on a TBB parameter in C# code. The same functionality can be achieved doing a double look-up directly in a Dreamweaver (DWT) TBB.
The idea behind the double look-up is the same -- I will first read a DWT variable (or expression), then perform the second look-up on the resulting variable (or expression). The syntax in DWT is the following:
@@OuterExpression${InnerExpression}@@
The @@expression@@ notation is equivalent to ${expression}. The whole trick is in the order of evaluation: ${InnerExpression} is evaluated first, then the @@OuterExpression@@ is evaluated.
Example:
<!-- TemplateBeginRepeat name="ImageList" -->
<img src="@@Image_${TemplateRepeatIndex}@@"/>
<!-- TemplateEndRepeat -->
Note that the other way of nesting the tags won't work! This won't work ${Outer@@Inner@@}.
The idea behind the double look-up is the same -- I will first read a DWT variable (or expression), then perform the second look-up on the resulting variable (or expression). The syntax in DWT is the following:
@@OuterExpression${InnerExpression}@@
The @@expression@@ notation is equivalent to ${expression}. The whole trick is in the order of evaluation: ${InnerExpression} is evaluated first, then the @@OuterExpression@@ is evaluated.
Example:
- ImageList is a package item holding an array of Components;
- Image_0, Image_1, etc... are package items holding URL values for each item of ImageList;
<!-- TemplateBeginRepeat name="ImageList" -->
<img src="@@Image_${TemplateRepeatIndex}@@"/>
<!-- TemplateEndRepeat -->
Note that the other way of nesting the tags won't work! This won't work ${Outer@@Inner@@}.
Comments