# Autogenerated field types

Out of the box, you get enhanced field editors for the following property types:

## String

The string property displays an input field.

It looks in the following way:

To insert a string, use the following code sample:

```C#
using System.ComponentModel;
using Progress.Sitefinity.Renderer.Entities.Content;
using Progress.Sitefinity.Renderer.Designers.Attributes;

namespace SitefinityWebApp
{
   public class DemoString
   {
     public string InputField { get; set; }
   }
}
```

## Boolean

The Boolean property displays a Yes/No or a checkbox option.\
The Boolean field can look either like a radio button or like a single checkbox.

### Radio button

![bool-field](https://www.progress.com/documentation/sitefinity-cms/assets/5ae06e8bfd8ad0f8d8df8667f47b79fe/bool-fieldd5c640b42bbc6d27ad54ff0300e02f5f.png "bool-field")

### Checkbox

![CheckboxAuto](https://www.progress.com/documentation/sitefinity-cms/assets/49f70ea98f36a3198ef6ec0b415a9c6f/checkboxauto.png "CheckboxAuto")

To insert a Boolean field, use the following code sample:

```C#
using System.ComponentModel;
using Progress.Sitefinity.Renderer.Entities.Content;
using Progress.Sitefinity.Renderer.Designers.Attributes;

namespace SitefinityWebApp
{
   public class DemoBoolean
   {
     //Radio button yes/no
     
     [DisplayName("Boolean field")]
     public bool CheckboxField { get; set; }
     
     //Checkbox yes/no
     
     [Group("Options")]
       [DisplayName("Checkbox field")]
       [DefaultValue(true)]
       [DataType(customDataType: KnownFieldTypes.CheckBox)]
       public bool CheckboxField { get; set; }
   }
}
```

## Enum

The property displays a selector with all available options for the enumerator.

The selector can allow single or multiple values to be selected.

The multiple option selector looks in the following ways:

![enum-multiple](https://www.progress.com/documentation/sitefinity-cms/assets/e49b06d556a3b0afc1084e79d8129e5a/enum-multipleddc640b42bbc6d27ad54ff0300e02f5f.png "enum-multiple")

The single option selector looks in the following ways:

![enum-single](https://www.progress.com/documentation/sitefinity-cms/assets/614c9d8f26db8a1f84ce392c8f025d95/enum-singlee4c640b42bbc6d27ad54ff0300e02f5f.png "enum-single")

![EnumChipChoice](https://www.progress.com/documentation/sitefinity-cms/assets/683573ea6a7fd413061498cbc9eff570/enumchipchoice.png "EnumChipChoice")

![EnumIntegerChoice](https://www.progress.com/documentation/sitefinity-cms/assets/f7d3b490f2770df6ea1fbc7eb85cdcdb/enumintegerchoice.png "EnumIntegerChoice")

![Integer as dropdown](https://www.progress.com/documentation/sitefinity-cms/assets/36b7cf5ba39b892b27482c93e206f130/integer-as-dropdown.png "Integer as dropdown")

To insert an enumerator field, use the following code sample:

```C#
using System.ComponentModel;
using Progress.Sitefinity.Renderer.Entities.Content;
using Progress.Sitefinity.Renderer.Designers.Attributes;

namespace SitefinityWebApp
{
   public class DemoEnum
   {
     //Single option enumerator 
     
     [DefaultValue(EnumSingle.Value2)]
     public EnumSingle EnumDefaultValue { get; set; }
       
     //Multiple option enumerator 
     
     [DefaultValue(EnumMultiple.Value1 | EnumMultiple.Value2)]
     public EnumMultiple EnumDefaultValueMultiple { get; set; }
     
     //Chip choice enumerator
     
     [DataType(customDataType: KnownFieldTypes.ChipChoice)]
     public EnumSingle EnumChipChoice { get; set; }

     //Integer choice enumerator
     
     [DefaultValue(1)]
     [DisplayName("Integer as choice field")]
     [DataType(customDataType: KnownFieldTypes.ChipChoice)]
     [Choice("[{\"Title\":\"1 level\",\"Name\":\"1\",\"Value\":1,\"Icon\":null},{\"Title\":\"2 levels\",\"Name\":\"2\",\"Value\":2,\"Icon\":null},{\"Title\":\"3 levels\",\"Name\":\"3\",\"Value\":3,\"Icon\":null}]")]
     public int? IntAsChoice { get; set; }
       
     //Integer as dropdown enumerator
     
     [DefaultValue(1)]
     [DisplayName("Integer as dropdown field")]
     [DataType(customDataType: KnownFieldTypes.Choices)]
     [Choice("[{\"Title\":\"1 level\",\"Name\":\"1\",\"Value\":1,\"Icon\":null},{\"Title\":\"2 levels\",\"Name\":\"2\",\"Value\":2,\"Icon\":null},{\"Title\":\"3 levels\",\"Name\":\"3\",\"Value\":3,\"Icon\":null}]")]
     public int? IntAsDropdownChoice { get; set; }
   }
   
   public enum EnumSingle
   {
     Value1,
     Value2,
     Value3
   } 
   
   [Flags]
   public enum EnumMultiple
   {
     Value1 = 0x01,
     Value2 = 0x02,
     Value3 = 0x04
   }
}
```

If you want to customize the names of the enumerators, use the `System.ComponentModel.DescriptionAttribute` class in the following way:

```C#
using System.ComponentModel;

namespace SitefinityWebApp
{
   public class ChangeEnum : DescriptionAttribute
   {
       public enum EnumSingle
       {
           [Description("First value")]
           Value1,
           [Description("Second value")]
           Value2,
           [Description("Third value")]
           Value3
       }
   }
}
```

## Group

This attribute groups separate checkbox fields visually into a single field. The group name is displayed as a label for the composite field. This attribute can be used when you do not want to use an `enum` type to display a multiple option selector.

The attribute looks in the following way:

![CoreGroup](https://www.progress.com/documentation/sitefinity-cms/assets/538f22f8c7fb7ea18a1fbcaa649f237c/coregroup.png "CoreGroup")

To add this attribute, use the following code:

```C#
using System.ComponentModel;
using Progress.Sitefinity.Renderer.Designers.Attributes;
using System.ComponentModel.DataAnnotations;
using Progress.Sitefinity.Renderer.Designers;

namespace SitefinityWebApp
{
   public class DemoGroup
   {

       [Group("Options")]
       [DisplayName("Checkbox field")]
       [DataType(customDataType: KnownFieldTypes.CheckBox)]
       public bool CheckboxField { get; set; }

       [Group("Options")]
       [DisplayName("Checkbox field 2")]
       [DataType(customDataType: KnownFieldTypes.CheckBox)]
       public bool CheckboxField2 { get; set; }
   }
}
```

## Int, double

This property displays a number field that can be an integer or a floating number.

It looks in the following way:

![int](https://www.progress.com/documentation/sitefinity-cms/assets/42c8c827b7f4386a40a352eed6052821/int.png "int")

To insert it, use the following code sample:

```C#
using System.ComponentModel;
using Progress.Sitefinity.Renderer.Entities.Content;
using Progress.Sitefinity.Renderer.Designers.Attributes;

namespace SitefinityWebApp
{
   public class DemoInt
   {
     [DisplayName("Int prop")]
     public int IntProp { get; set; }
   }
}
```

## DateTime

This property displays a date-time picker.

It looks in the following way:

![date-field](https://www.progress.com/documentation/sitefinity-cms/assets/8d897974ca14043f4d60b55a5979af62/date-field32c740b42bbc6d27ad54ff0300e02f5f.png "date-field")

To insert it, use the following code sample:

```C#
using System.ComponentModel;
using Progress.Sitefinity.Renderer.Entities.Content;
using Progress.Sitefinity.Renderer.Designers.Attributes;

namespace SitefinityWebApp
{
   public class DemoDateTime
   {
     [Required(ErrorMessage = "This is required date.")]
     public DateTime DateFieldRequired { get; set; }
   }
}

```

## LinkModel

This property displays a link selector. You can use it to select external links or link to a specific Sitefinity CMS page or content item.

The link selector field is available in the following two representations:

* Link selector introduced before Sitefinity CMS version 14.4

  ![link-field](https://www.progress.com/documentation/sitefinity-cms/assets/a1cf2ba1258dda5919561e1b4a4699eb/link-field5ec740b42bbc6d27ad54ff0300e02f5f.png "link-field")

  To insert a link selector field, use the following code example:

  ```C#
  using System.ComponentModel;
  using Progress.Sitefinity.Renderer.Entities.Content;
  using Progress.Sitefinity.Renderer.Designers.Attributes;

  namespace SitefinityWebApp
  {
      public class DemoLinkModel
      {
        [Required]
        public LinkModel LinkRequired { get; set; }
      }
  }

  ```
* Link selector available as of Sitefinity CMS version 14.4

  ![link-selector](https://www.progress.com/documentation/sitefinity-cms/assets/ebd5fe28b660ae99d2c9aabb25126953/link-selector.png "link-selector")

  The newer implementation of link selector field introduces the attribute `[DataType(customDataType: "linkSelector")]` that is added to the `LinkModel` property.\
  The following code demonstrates how to insert this link selector field:

  ```C#
  using System.ComponentModel;
  using Progress.Sitefinity.Renderer.Entities.Content;
  using Progress.Sitefinity.Renderer.Designers.Attributes;

  namespace SitefinityWebApp
  {
      public class DemoLinkModel
      {
          [Required]
          [DataType(customDataType: "linkSelector")]
          public LinkModel ExtendedLinkRequired { get; set; }

          [DataType(customDataType: "linkSelector")]
          public LinkModel[] MultipleExtendedLinks { get; set; }
      }
  }
  ```

## MixedContentContext

You use this property to **select content**, such as news or pages.\
This field type works with the `ContentAttribute` and sets the property to behave as an item selector. This selector can work with different types of providers and you can configure it to display live or draft data.

> info **NOTE**: Except for libraries, this selector supports selection of items from multiple providers, in case, you have more than one provider for the type in the current site.

You can use the `MixedContentContext` to create a selector for the following:

* Pages
* Content items
* Media items
* Libraries and folders
* Dynamic content items
* Taxonomies
* Custom taxonomies
* All content items\
  You use this selector to display items from any content type - static or dynamic, except for pages and media items.\
  When you select a content type, you can further filter the content or preselect existing items. The selector provides options for filtering content taxa or time periods, as well as sorting options.

You can also:

* Control whether single or multiple selection is allowed
* Control whether to display live or draft data in the selectors.\
  You cannot do this for pages, media items, and libraries.
* Control whether a site selector should appear in the show all dialog in order to be able to select content from different sites.\
  You cannot do this for taxonomies and libraries
* Control whether the selected items can be previewed.
* Control which content types are displayed. You have the option to specify the content types that are listed in the displayed items by explicitly including them with the `Type` paramater or excluding them with the `TypeBlacklist` paramater.

The following are examples of how some content selectors look like:

**Pages selector**

![page-selector](https://www.progress.com/documentation/sitefinity-cms/assets/051acd71c227bb5edfca784844e469ee/page-selector.png "page-selector")

**Images selector**

![image-selector](https://www.progress.com/documentation/sitefinity-cms/assets/c1ed755200c7968ff4fb8dd8c3005148/image-selector.png "image-selector")

**Libraries selector**

**![Libraries selector](https://www.progress.com/documentation/sitefinity-cms/assets/8d921fcb0c5f95cf9d9882fd200b1eb9/libraries-selector.png "Libraries selector")**

**All content types selector**

![AllTypesSelector](https://www.progress.com/documentation/sitefinity-cms/assets/80fc4ed89c43c34c96bd934f414c473b/alltypesselector.png "AllTypesSelector")

To insert a content selector, use the following code sample:

```C#
using System.ComponentModel;
using Progress.Sitefinity.Renderer.Entities.Content;
using Progress.Sitefinity.Renderer.Designers.Attributes;

namespace SitefinityWebApp
{
   public class DemoMixedContentContext
   {
       [Content]
       public MixedContentContext AllTypes { get; set; }

       [Content(Type = KnownContentTypes.News)]
       public MixedContentContext News { get; set; }

       [Content(Type = KnownContentTypes.News, LiveData = true)]
       public MixedContentContext NewsLive { get; set; }

       [Content(Type = KnownContentTypes.News, ShowSiteSelector = true)]
       public MixedContentContext NewsMultiSite { get; set; }

       [Content(Type = KnownContentTypes.News, DisableInteraction = true)]
       public MixedContentContext NewsNoPreview { get; set; }

       [Content(Type = KnownContentTypes.Pages, AllowMultipleItemsSelection = false)]
       public MixedContentContext Page { get; set; }

       [Content(Type = "Telerik.Sitefinity.DynamicTypes.Model.Pressreleases.PressRelease")]
       public MixedContentContext PressReleases { get; set; }

       [Content(Type = KnownContentTypes.Images)]
       public MixedContentContext Images { get; set; }
       
       [Content(Type = KnownContentTypes.Albums)]
       public MixedContentContext Albums { get; set; }

       [Content(Type = KnownContentTypes.DocumentLibraries, AllowMultipleItemsSelection = false, AllowCreate = false, Provider = "secondlibraries")]
       public MixedContentContext DocumentLibrary { get; set; }		[Content(Type = KnownContentTypes.Albums)]
       public MixedContentContext Albums { get; set; }
   // You can provide multiple types with a comma separated value.	// To explicitly include content types use the Type property.	// To explicitly exclude content types use the TypeBlacklist property.
       [Content(		Type = $"{KnownContentTypes.ListItems}, {KnownContentTypes.News}",		TypeBlacklist = "Telerik.Sitefinity.DynamicTypes.Model.Pressreleases.PressRelease"	)]
       public MixedContentContext SelectedItems { get; set; }

       // IMPORTANT: The value you provide in the Type parameter of the TaxonomyContent attribute is case-sensitive and 
       // must be the developer name of the taxonomy.
       [TaxonomyContent(Type = "GeographicalRegions")]
       public MixedContentContext GeographicalRegions { get; set; }
   }
} 
```

For more information about using selectors, see Sitefinity GitHub » [Content selectors](https://github.com/Sitefinity/sitefinity-aspnetcore-mvc-samples/tree/master/src/content-selectors).

> info **NOTE**: For helper methods that automatically fetch the items in the `MixedContnetContext` class that uses the `Progress.Sitefinity.RestSdk.IRestClient` interface, include the namespace `Progress.Sitefinity.AspNetCore.RestSdk`

## List

You use this property to add a list section. A list can contain only strings or only complex objects.

A list is declared as `List<T>` in the code. The generic parameter in the `List<T>` property can be of type `string` or a complex object with primitive properties. Complex properties with non-primitive types are not supported.

The following screenshot displays a list of strings:

![List of strings](https://www.progress.com/documentation/sitefinity-cms/assets/fe0e377ffe90e4cdba888de7f44d24c1/list-of-strings.png "List of strings")

To insert a list, use the following code sample:

```C#
using System.ComponentModel;
using Progress.Sitefinity.Renderer.Entities.Content;
using Progress.Sitefinity.Renderer.Designers.Attributes;

namespace SitefinityWebApp
{
   public class DemoList
   {
     public IList<string> List { get; set; }
     public IList<ComplexObject> ListComplexObject { get; set; }
   }
}
```

## Complex objects

A complex object is a property that consists of other simple properties or complex objects. Sitefinity CMS automatically generates editors for the them. You can also configure to display many complex objects in a table view.

For more information, see [Autogenerated Complex objects](https://www.progress.com/documentation/sitefinity-cms/autogenerated-complex-objects).

## Other types

All other types are displayed using a text field where you can type your values.
