#Protip: Reading Fields from Template Field

If you add any fields to the Template Field item (because you want to customize something for all fields), you’ll need to read individual fields from the item that defines the field – which is Template Field. Very easy – just read from InnerItem.Fields:

Item i = //get your item
foreach (Field field in i.Fields)
{
     var fieldValue = field.InnerItem.Fields["FieldName"].Value;
}

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s