HomeDev GuideAPI Reference
Dev GuideAPI ReferenceUser GuideGitHubNuGetDev CommunitySubmit a ticketLog In
GitHubNuGetDev CommunitySubmit a ticket


Important

This topic describes unsupported functionality for complex types in Optimizely Content Management System (CMS) that the implementing developer is responsible for validating to ensure that it works for the item types you want, because supporting complex types as list items brings a whole set of unknowns. Using `PropertyList<T>` together with complex types requires additional custom functionality to fully ensure data consistency, portability and functionality. This includes, but is not limited to UI, Settings, Export/Import, Permanent link handling and default values.

CMS recommends using `ContentArea` and `Blocks` for lists of complex objects. Using blocks for complex types provides a much more controlled object structure.

`PropertyList` is a property that lets you define an editable list of objects. Content model can implement a property of type `IList<T>` where T is a class with property definitions.



## Example - list of locations

This example shows how to implement a list of locations.

755


`PropertyList` lets the editor edit items using a dialog window.

757


The list contains items with string properties:

  • address list 1

  • address line 2

  • city

  • country.

First we have to define `Location` model class. It will represent the property item.



The next step is to register the property definition using a custom property class `LocationsProperty` that sets the generic type to `Location` item class:



Finally we can add list of locations on the page:



## Localize item properties

You can translate list item properties in a similar way as `Content` properties translation. You can translate properties using `DisplayAttribute` and language files. See [Localizing the user interface](🔗).