Hello! In Kentico 11 we retrieved document category id like this
DocumentToProductsCodeName = "DocumentstoProducts6442498230"; DocumentToProductsCategoryID = BaseAbstractInfoProvider.GetId("cms.category", DocumentToProductsCodeName);
Kentico 12 Upgrade tool says that I need to use CMS.DataEngine.AbstractInfoProvider<TInfo, TProvider, TQuery> instead.
CMS.DataEngine.AbstractInfoProvider<TInfo, TProvider, TQuery>
Again, the problem is that there is no examples i found. Can someone suggest links to example, or show me how can I get category id by name in Kentico 12? Thank you.
According to API documentation there is CategoryInfoProvider. See example:
// Gets the page category CategoryInfo category = CategoryInfoProvider.GetCategoryInfo("Carnivores", SiteContext.CurrentSiteName);
Roman, thank you for pointing this!
Please, sign in to be able to submit a new answer.