Basically, the DWT template allows you to iterate through arrays, and there is only one type of array in the Package that we can click on ourselves, this is the Component Presentation array (which can contain the TCMURI components of the Component Template, but also the Component TCMURI).
With this, you can click (what I call) the Dummy Component array in the package, which you can use to cycle through, and then use the double search function to make it work like a loop over a set of package variables.
For example, you insert a Component Array package with three dummy TCMURIs (they can all be tcm: 0-0-0, no matter what value they have). Then you create three package variables: Var_0, Var_1, Var_2. Now in your DWT template you can use:
<!-- TemplateBeginRepeat name="MyDummyArray" --> @@Var_${TemplateRepeatIndex}@@ <!-- TemplateEndRepeat -->
Which will result in the values โโof the three package variables.
Unfortunately, there is no way to create a string array directly or an array of fields, if so, so for everything you want to iterate over, you will have to use an existing array of fields or create a "massive component array".
From which we can really conclude that your example is impossible, as it is written, but when you click a dummy array with them in the Package, you can iterate over it and have what you want.
Bart koopman
source share