Sitefinity CMS exposes manager classes for every type of content. This is the case for taxonomies, as well. Consider the following example:
You are working with the TaxonomyManager class, which is the manager class for taxonomies. It has helper methods for creating a taxonomy: CreateTaxonomy(), managing taxonomies, and creating taxons.
NOTE: The new taxonomy must have a name, title, root taxon name, and description. The Name gets or sets the programmatic name of the taxon, whereas the Title gets or sets the display title of the taxonomy.
After setting the taxonomy properties, you create the first taxon and set its properties as well. The taxon is added to the taxonomies taxa (taxon collection) via the taxonomy class helper method Add(Taxon taxon).
Finally, you call the SaveChanges(), so that a transaction with all the changes is created and run.
To find a taxonomy:
You can also get a taxonomy by ID using the GetTaxonomy(Guid id) method. Searching for a taxon or taxa is very similar to searching for a taxonomy:
Once you have the taxa or taxonomy instance, you can associate them with a content item.
Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.
This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.
This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important