Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

UIHint.CatalogContent not working for ContentArea properties?

Vote:
 

I've worked with Commerce for quite a while, so am not sure how it was in the past, but I expected UIHint.CatalogContent to work with a ContentArea property:

[Display(
    Name = "Test A",
    GroupName = SystemTabNames.Content,
    Order = 5)]
[UIHint(UIHint.CatalogContent)]
[AllowedTypes(typeof(VariantContent))]
public virtual ContentArea TestA { get; set; }

But, when clicking "Browse existing content" it results in the UI picker just showing the media items.

However, if I have a ContentReference:

[Display(
    Name = "Test B",
    GroupName = SystemTabNames.Content,
    Order = 8)]
[UIHint(UIHint.CatalogContent)]
[AllowedTypes(typeof(VariantContent))]
public virtual ContentReference TestB { get; set; }

It loads the UI picker (by clicking the elipse next to the content reference) and as intended, this browses the catalog content in the pop up.

Is this expected? Is UIHint.CatalogContent just not compatible with ContentArea?

#336641
Feb 11, 2025 5:27
Vote:
 

Oh, I just realised I had forgotten about `UIHint.CatalogEntry` and `UIHint.ProductVariation` - but I quickly tried those:

[Display(
    GroupName = SystemTabNames.Content,
    Order = 7)]
[UIHint(UIHint.CatalogEntry)]
[AllowedTypes(typeof(VariantContent))]
public virtual ContentArea TestC { get; set; }

[Display(
    GroupName = SystemTabNames.Content,
    Order = 7)]
[UIHint(UIHint.ProductVariation)]
[AllowedTypes(typeof(VariantContent))]
public virtual ContentArea TestD { get; set; }

And they (with the ContentArea) still only bring up the media picker.

#336642
Edited, Feb 11, 2025 6:10
Vote:
 

This is a known issue I think. I know I logged a bug for it, will try to find it ...

#336644
Feb 11, 2025 11:04
Vote:
 

That's promising, thanks for the reply Quan - this codebase is long overdue an v13.x upgrade - they're on 13.19 (~2020), do you think it might have been fixed by the latest version (v13.37)?

#336663
Feb 11, 2025 22:18
Vote:
 

No as far as I am aware the bug is not fixed. Finding it is a bit tricky though because I'm not quite sure if I created it or just looked at it in the past. 

#336664
Feb 11, 2025 22:35
Vote:
 

The bug I found is CMS-30744. Should be same as yours right?

#336665
Feb 11, 2025 22:38
Vote:
 

Hmm, I think this is different. Mine is specific to using a ContentArea where I want to target Variations only. But leading Bug - CMS-30744 it sounds like it's more about the `AllowedTypes` and the example is with a `ContentReference`

#336666
Feb 11, 2025 22:52
Vote:
 

it's basically that [AllowedTypes(typeof(EntryContentBase))] attribute can't be applied to nested ContentReference property (inside a block or a ContentArea). I can't say with 100% certain they are the same bug, but they are likely linked 

#336691
Feb 12, 2025 8:11
Vote:
 

Hi, I've also encountered this problem and the bug mentioned above (CMS-30744) has "Closed, Won't Fix" as state. Would be a nice thing to have though as editors now have to drag content from the right side panel in order to add Node-items to a ContentArea. I'm on Commerce 14.33.0.

#337060
Edited, Feb 27, 2025 13:42
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.