Hi
Using Razor in my template I am looping throug the loop "ItemCreator:Edit.Item.Groups" and in that I am looping throug the loop "ItemCreator:Edit.Item.Group.Fields". In the fields loop I would very much like to get the required attributte for an itemtype field. This because I want to render a red star after the field label if the field is mandatory. But I can't see a required tag value! Here is my code:
@foreach (var group in GetLoop("ItemCreator:Edit.Item.Groups"))
{
<div class="item-edit-fields">
<div class="item-edit-field-group">
<div class="item-edit-field-group-name">@group.GetValue("ItemCreator:Edit.Item.Group.Name")</div>
<div class="item-edit-field-group-content ">
@foreach (var field in group.GetLoop("ItemCreator:Edit.Item.Group.Fields"))
{
<div class="item-edit-field items-clear">
<label class="item-edit-field-label">@field.GetValue("ItemCreator:Edit.Item.Field.Name") <span class="required">*</span></label>
<div class="item-edit-field-value">
@if (field.GetString("ItemCreator:Edit.Item.Field.EditorType").Contains("Dynamicweb.Content.Items.Editors.FileEditor"))
{
<input type='file' name='@field.GetValue("ItemCreator:Edit.Item.Field.SystemName")' accept='@field.GetValue("ItemCreator:Edit.Item.Field.Extensions")' />
}
else
{
@field.GetValue("ItemCreator:Edit.Item.Field.Control")
}
</div>
</div>
}
</div>
</div>
</div>
}