ItemPublisher:Item.[ItemFieldSystemName].IsRequired
Version: - booleanSummary
Returns True
if the item field is marked as required.
Settings
The value is based on the Required field in the item field settings.
(Management Center - Item types - [Item type] - [Item type field] - Required)
Examples
Outputting the template tag
@GetBoolean("ItemPublisher:Item.[ItemFieldSystemName].IsRequired")
Check if tag has a value
@if(!bool.IsNullOrWhiteSpace(GetBoolean("ItemPublisher:Item.[ItemFieldSystemName].IsRequired"))) {
@* Tag has value, so let's do something useful here. *@
}
Assign tag to a value for later use
@{
bool storedTag = GetBoolean("ItemPublisher:Item.[ItemFieldSystemName].IsRequired");
}
Outputting the template tag
<!--@ItemPublisher:Item.[ItemFieldSystemName].IsRequired-->
Check if boolean has a value
<!--@If Defined(@ItemPublisher:Item.[ItemFieldSystemName].IsRequired)-->
Let's output this tag here: <strong><!--@ItemPublisher:Item.[ItemFieldSystemName].IsRequired--></strong>
<!--@EndIf(@ItemPublisher:Item.[ItemFieldSystemName].IsRequired)-->