Documents for a certain category

Novice User asked on November 14, 2017 17:09

I want to list all documents from a category. And if parent category is selected, I want to list all documents from a parent category and sub category. Is there an API for this or I would have to query the database.

Recent Answers


Peter Mogilnitski answered on November 14, 2017 19:36 (last edited on November 14, 2017 19:37)

You can use DocumentQuery API

// Retrieves smartphones that are in the 'Phablets' category
DocumentQuery smartphones = DocumentHelper.GetDocuments("CMS.Smartphone")
                                .OnSite("CorporateSite")
                                .Path("/Products/", PathTypeEnum.Children)
                                .InCategories("Phablets");
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.