For developers: FlatTaxonField
FlatTaxonField is used in the same cases as HierarchicalTaxonField, but it associates items to taxa from flat taxonomies (i.e. Tags). All built-in content items already have dynamic properties to associate them with Tags, and you can create such properties for custom flat taxonomies. In all those cases, you can use FlatTaxonField.

FlatTaxonField in Write mode, used to select tags for a news item.

FlatTaxonField in Read mode, displaying the selected tags for a news item.
Using FlatTaxonField in your static modules through definitions
Taxonomies and taxa are associated with content items through dynamic properties, no matter if you are developing a static module or a dynamic one. With dynamic modules, the definition for the field is created through the UI. With static modules, you have to use the following code.
var tagsField =
new
FlatTaxonFieldDefinitionElement(section)
{
ID =
"tagsFieldControl"
,
DataFieldName =
"Tags"
,
DisplayMode = FieldDisplayMode.Write,
ResourceClassId =
typeof
(TaxonomyResources).Name,
TaxonomyId = TaxonomyManager.TagsTaxonomyId,
WebServiceUrl =
"~/Sitefinity/Services/Taxonomies/FlatTaxon.svc"
,
AllowMultipleSelection =
true
,
WrapperTag = HtmlTextWriterTag.Li,
Title =
"Tags"
,
ExpandableDefinitionConfig =
{
Expanded =
false
,
ExpandText =
"ClickToAddTags"
,
ResourceClassId =
typeof
(TaxonomyResources).Name
}
};
taxonSection.Fields.Add(tagsField);
You have to specify several properties. DataFieldName is the name of the dynamic field in the content item that holds the association with the taxon. TaxonomyId is the ID of the flat taxonomy you want to use. WebServiceUrl should always be the default URL of FlatTaxonService. The rest of the properties control the behavior of the field and you can set them according to your preferences.
Using FlatTaxonField for a custom dynamic field
When you are creating a custom field of type "classification" in any content module, the choice of the widget to select the classification items is available as a dropdown. When you select "Textbox selector", you are in fact selecting FlatTaxonField.
