Making subfields of embedded multivalue fields editable
To access one value of an embedded multivalue field, simply use an index on the multivalue field in your calls to FieldStartMarker and GetFieldValue.
For example, this call retrieves the house number of the third address in the Addresses field:
@@FieldStartMarker("Addresses[2].HouseNumber")@@
@@FieldValueStartMarker()@@
@@GetFieldValue("Addresses[2].HouseNumber", 0)@@
@@FieldValueEndMarker@@
@@FieldEndMarker@@
If you want to iterate over the values of the multivalue field, you can create a repeating region and fill in the iterator variable for the index. Be sure to delimit this iterator separately:
@@FieldStartMarker("Addresses[${TemplateRepeatIndex}].HouseNumber")@@
@@FieldValueStartMarker()@@
@@GetFieldValue("Addresses[${TemplateRepeatIndex}].HouseNumber", 0)@@
@@FieldValueEndMarker@@
@@FieldEndMarker@@
Note how the iterator variable TemplateRepeatIndex is enclosed in a its own delimiters ${ and }, so as not to confuse them with the @@ delimiters around the call to FieldStartMarker (see Delimiters).
This call results in the following published output if the field has two values:
<span id="_SE_FLD" _SE_FLD="tcm:Content/custom:Content/custom:Addresses[1]/custom:HouseNumber[1]">
<span id="_SE_FLD" _SE_FLD="tcm:Content/custom:Content/custom:Addresses[2]/custom:HouseNumber[1]">