London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

Restrict catalog items based on type

Vote:
 

I am wanting to create a couple of catalog nodes and restrict the product/variation types which users can create under them.

For instance, you might have a Clothes Catalog and a Shoe Catalog. And then a ClothingProduct and a ShoeProduct. I only want to be able to create ShoeProduct under the Shoe Catalog etc.

I've had a look at documentation and couldn't see anything like this. I have tried to roll my own custom catalog inhertining Catalog and then using AvailableContentTypes to restrict types but this didn't work, maybe I need a UI Descriptor for it to show in the CMS, I am unsure.

Running 11.8.2

Any help would be great.

#192698
Edited, May 23, 2018 11:19
Vote:
 

You can't extend or inherit CatalogContent. A workaround is to have an immediate Node, like Shoes, under Shoe Catalog, which is an extended NodeContent class with proper AvailableContentTypes attribute. 

#192701
May 23, 2018 12:37
Vote:
 

Does this mean you create your catalog root (Type:Catalog) and then extend the Category node with proper AvailableContentTypes. Or are you talking about a completely new type of node in addition to Category, Packages etc

#192702
May 23, 2018 12:49
Vote:
 

It is like this 

Shoe Catalog => Shoes => Brands => .... (shoes)

You can have ShoesNodeContent extends NodeContent and add AvailableContentTypes to it. Then create Shoes from ShoesNodeContent 

#192703
May 23, 2018 12:52
Vote:
 

Something as simple as? - 

    [ContentType(
        GUID = "FFE372D9-EBEA-48C9-B723-3293E1B2A53C",
        DisplayName = "Shoe Node",
        Description = "Shoe Node")]
    public class ShoeNodeContent : NodeContent
    {
    }

This causes "Multiple custom attributes of the same type found"

#192706
May 23, 2018 13:28
Vote:
 

What are you talking about? This is from our QuickSilver:

    [CatalogContentType(
        GUID = "a23da2a1-7843-4828-9322-c63e28059f6a",
        MetaClassName = "FashionNode",
        DisplayName = "Fashion Node",
        Description = "Display fashion products.")]
    [AvailableContentTypes(Include = new[] 
    {
        typeof(FashionProduct),
        typeof(FashionPackage),
        typeof(FashionBundle),
        typeof(FashionVariant),
        typeof(NodeContent)
    })]
    public class FashionNode : NodeContent
    {

    }
#192708
May 23, 2018 13:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.