Try our conversational search powered by Generative AI!

Creation of a Catalog Page Model/View - Commerce 11


Is it possible to have a page view/model for the catalog in Commerce?

The documentation here specifically states to not inherit from CatalogContent because "they only exist to show various states in the system".

I've attempted to connect the content type to the metaclass using the [CatalogContentType ( MetaClassName = "Catalog")], but that didn't appear to work.

Has anyone managed to do this? Or got any pointers on how to achieve this?

Apr 03, 2018 17:51

It is not possible. What would you want to show in a catalog page? There is nothing prevent you from returning a CMS view in your catalog controller 

Apr 03, 2018 19:10

Thanks for your response Quan.

I was hoping to use it for a primary category listing. Ideally our catalog will sit at /products and have urls like /products/cat1, /products/cat1/some-product etc. We had planned to use the url /products to list out the top level categories.

I'll go for the controller route instead and define the content for it elsewhere.



Apr 03, 2018 21:37

I think it makes perfect sense to display all top level categories on such a page. The idea is that any segment in the url should be routable.

It can easily be achieved by creating a controller of type ContentController<CatalogContent>. From there you can build any model of your choice, but as you've already found out - should you require additional properties on the catalog you will need to store them elsewhere.

Apr 04, 2018 2:12
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.