HierarchicalTaxonField is used when you want to associate a content item with a hierarchical taxon (i.e. category). Built-in content items have Category and Tags fields available, but you can also create custom fields for all modules, which are of type "classification". With all those, you can use HierarchicalTaxonField:
Taxonomies and taxa are associated with content items through the creation of custom fields, no matter if you're developing a static module or a dynamic one. The difference is in the way you create the definition. With a static module, you need to do it with the following code:
var categorySelectorField =
DisplayMode = FieldDisplayMode.Write,
TaxonomyId = TaxonomyManager.CategoriesTaxonomyId,
WrapperTag = HtmlTextWriterTag.Li,
When you are creating a custom field of type "classification", the choices for a widget to select classification items is available as a dropdown list. If you choose "Tree-like selector", you are in fact choosing HierarchicalTaxonField. You don't need to specify a custom type. You can also choose the taxonomy to work with.
Back To Top