I am converting a DWT into a Razor template. In the Razor template I have a foreach loop. Inside of that foreach loop I am attempting to render a field of the current item using RenderComponentField. In the DWT this was done as follows:
<!-- TemplateBeginRepeat name="MultivaluedField" -->
@@RenderComponentField(FieldPath+".Target", 0)@@
<!-- TemplateEndIf -->
And so far in Razor I have this:
@foreach (var item in Fields.MultivaluedField) {
@RenderComponentField(???+".Target", 0)
}
Where "MultivaluedField" is a field which takes takes multiple values of an embedded schema. I cannot figure out how to get the field path of the item in this loop. I've tried item.fieldPath, and item.Path. I've also looked over the razor documentation. Perhaps RenderComponentField is not used in Razor templating, and I am searching for the wrong answer.
How would one access the field path of an item inside of a foreach loop using razor templating?