Imagine that I have created normally a loop (variable "loopTemplate") with 3 elements in a template (variable "template"), and the result can be shown like this:
<!--@LoopStart(Person.DivisionsList)--> Counter: <!--@Person.DivisionsList.LoopCounter--> <br /> Title: <!--@Person.DivisionsList.Title--> <br /> Meters: <!--@Person.DivisionsList.Meters--> <br /><br /> <!--@LoopEnd(Person.DivisionsList)-->
Counter: 1
Title: Room 1
Meters: 12
Counter: 2
Title: Kitchen
Meters: 17
Counter: 3
Title: Room 2
Meters: 25
How can I add a Tag to each element of the loop after the foreach() cicle and "loopTemplate.CommitLoop()" proccess??
For example, to add a "Person.DivisionsList.Color" tag to each element of the loop...
I've tried an approach like this...
Loop loop = template.Loops.GetLoopByName("Person.DivisionsList"); loop.Template.SetTag("Person.DivisionsList.Color", "Red"); loop.Template.SetTag("Person.DivisionsList.Color", "Blue"); loop.Template.SetTag("Person.DivisionsList.Color", "White"); loop.Template.CommitLoop();
...but it adds a 4th loop element with only the last tag (the color white).
I need to navigate the loop and add a tag to each element, but the "loop.Template.Tags" property is empty to create a foreach, for example.
Any ideas?
Thanks,
Diogo