Showing posts with label vbscript. Show all posts
Showing posts with label vbscript. Show all posts

Thursday, 22 March 2012

Tridion Loop through multiple embedded fields


Schema


Embeddable Schema

Field1 and Field2 both optional and multi value.



Component




Component Template
[%
For Each value in Component.Fields.Item("EmbeddedFields").Value
                For Each value2 in value.Item("Field1").Value
                                WriteOut "Field1: " & value2 & "<br>"
                Next
                For Each value2 in value.Item("Field2").Value
                                WriteOut "Field2: " & value2 & "<br>"
                Next
Next
%]


The outcome