How to get Tridion FieldType in Tridion 2011?

Is it possible to get field type in Tridion 2011 TOM.NET?

The ItemField class has a name and definition, but I do not see the old trusted ItemType property.

I have a feeling that I need to use the Definition property, but am not sure which is the cleanest way.

Any ideas?

+6
source share
1 answer

You can use the following method to check the type of a field:

itemField is EmbeddedSchemaField itemField is KeywordField 

and Itemfield GetType also provides the same information.

 switch (itemField.GetType().Name) { case "EmbeddedSchemaField": fieldType = "EmbeddedSchema"; break; case "DateField": fieldType = "Date Field"; break; case "MultiLineTextField": fieldType = "RTF Text"; break; default: break; } 
+8
source

All Articles