I’m using Ektron CMS version 8.5 SP2.
I have some items in a taxonomy. Some are actual pages, some are library items (documents like Word files and PDFs).
Let’s say there are 3 pages and 2 library items for a total of 5 items in my taxonomy.
I use the following code…
ContentManager cManager = new Ektron.Cms.Framework.Content.ContentManager();
Ektron.Cms.Content.ContentTaxonomyCriteria ctCriteria = new Ektron.Cms.Content.ContentTaxonomyCriteria();
ctCriteria.AddFilter(1707, true); // hard coded taxonomy ID
List<ContentData> list = cManager.GetList(ctCriteria);
Label1.Text = list.Count.ToString();
When this code runs, the count of items in the list is 3. If I output the actual list, I can see it’s only the pages in the taxonomy, not the 2 library items.
It seems that the ContentManager.getList() function does not get library items, even when those items have been added to the taxonomy. I can confirm that in the admin workarea, the library items are visible in the taxonomy.
For clarification, this is a problem with retrieving items that have already been added to the taxonomy.
Does anyone know how I can retirieve a list of all items in a taxonomy, including any library items in there.
Note: If I add the files to the Document Managment System instead of the library, it works perfectly. But in the live system, I have hundreds of items in the library and I’m hoping theres’ a way to view them via a taxonomy without having to move them all into the DMS.
I have posted this question on the Ektron developers forum as well, but I’ve had no reply. I’m hoping somebody here can help.
Cheers.
A follow up to my comment from the other day on @nedlud’s answer, I felt like this deserved its own answer though.
According to the Framework API docs:
But as already noted in the comments, the
TaxonomyItemDataobjects returned by this API have a number of empty properties such asQuickLinkandHtml. I’ve found that using theTaxonomyManager, one can successfully query for items assigned to particular taxonomy categories.Here’s a brief snippet using the Framework API (version >= 8.5); this feels reminiscent of working with the older (version <= 8.0) taxonomy API wherein one would create a
TaxonomyRequestand get an object structure back that encapsulated not only the taxonomy iteself, but the items categorized into that taxonomy:I’m currently refactoring some version 8.0 code into version 8.6 and converting to the Framework API. Until Ektron fixes the (bug?) of
TaxonomyItemManagerreturningTaxonomyItemDatawith null properties, I’ll be using the above method +LINQfor the sorting/filtering/etc.