Hello!
I want to get category by part of it's code name. I'm trying to use PageTemplateCategoryInfoProvider.GetSiteCategoriesList() but it requires string "where" statement which i don't know how to pass.
PageTemplateCategoryInfoProvider.GetSiteCategoriesList()
I tried some SQL-style code like
var categoriesList = PageTemplateCategoryInfoProvider.GetSiteCategoriesList( SiteContext.CurrentSiteID, "CategoryName like '%6442498327'", "CategoryID Desc");
but it doesn't work: Additional information: Object type 'cms.class' not found.
Additional information: Object type 'cms.class' not found.
Can someone explain me or give a link to a guideline about this kind of Kentico API?
Also, how should i rewrite my code to get categories i want?
Thanks in advance!
If you want to get categories then use something like:
var categories = CategoryInfoProvider.GetCategories().WhereLike("CategoryName", "6442498327").OnSite(SiteContext.CurrentSiteName, false).OrderByDescending("CategoryID");
Thank you, Brenden!
Please, sign in to be able to submit a new answer.