Geta / geta-optimizely-categories

An alternative to Optimizely's default category functionality, where categories are instead stored as localizable IContent.
5 stars 10 forks source link

Multiple category selector issue #16

Open adayinthelifeofapro opened 1 year ago

adayinthelifeofapro commented 1 year ago

So following this part of the documentation:

If you prefer to use the native content reference list editor for your categories you can skip the CategoriesAttribute:

[AllowedTypes(typeof(TopicCategory))]
public virtual IList<ContentReference> TopicCategories{ get; set; }

If I implement the above, then it never shows any categories, it just displays the root node:

757b0314-78d2-42e8-817a-92575985ed12

If I implement the single category property, it displays fine:

[UIHint(CategoryUIHint.Category)] [AllowedTypes(typeof(TopicCategory))] public virtual ContentReference TopicCategory{ get; set; }

image

epi-pouellette commented 1 year ago

Hello,

We are seeing the same issue with not using the Categories Attribute on the IList<>. The only way we can get the dialog to work is by using StandardContentBase as the allowed type, which is not optimal.

I've checked the browser console, and I'm not seeing any console errors. I am seeing that the request (see below) to the store is not returning any objects when using a type that extends from CategoryData.

EPiServer/cms/Stores/contentstructure/?referenceId=1&query=getchildren&typeIdentifiers=projectname.models.categories.shareclasscategory&typeIdentifiers=geta.optimizely.categories.categorydata&allLanguages=true&sort()