Groups
Summary
The Groups
loop lets you display the custom field group.
Examples
Basic usage
Notice the use of @item.GetValue to get data from the loop variable.
If you just write @GetValue, the data will be taken from outside the loop.
Similarly, you have to use @item.GetLoop to use loops inside a loop.
<table>
<tr>
@foreach (LoopItem item in GetLoop("Groups") {
<td> @item.GetValue("Relevant.Tag") </td>
}
</tr>
</table>
Check if the loop exists
@if (Loops.Contains("Groups")) {
...
}
Example of usage
The following general example illustrates how to use a loop construct.
<table>
<!--@LoopStart(Groups)-->
<tr>
<td><!--@Loop:Tag--></td>
</tr>
<!--LoopEnd(Groups)-->
</table>
Check if the loop exists
<!--@If LoopDefined(Groups)-->
...
<!--@EndIf(Groups)-->
Available tags
Ecom:Product:GroupField.Group.ID
Returns group ID.
RAZOR
@GetString("Ecom:Product:GroupField.Group.ID")
Ecom:Product:GroupField.Group.Name
Returns group Name.
RAZOR
@GetString("Ecom:Product:GroupField.Group.Name")
Available loops
Fields
The Fields
loop lets you display the custom field within the group.
RAZOR
@foreach (LoopItem item in GetLoop("Fields")){ <p>@item.GetValue("TagName")</p> }