Shortening the Commerce Route (11.8.2)

Member since: 2010
 

I have the following structure defined in the our build

This structure has 3 different catalogs which we've currently create as node off the main catalog rather than catalog themselves. Each one of these need to map to their own controller and also has some custom properties which is why we have not chosen to create them at direct catalogs.

Unfortunately this has caused our url structure to have /main-catalogue/ in the URL which I don't want. Is it easy to either. I've tried creating a type that inherited catalog with the hopes I could be able to create different types of catalog but it through an error

Can we remove this top catalog from the routing using custom routing in the URL so the URL off the domain can be

/course-catalogue/

/supplier-catalogue/

/donation-catalogue/

FYI I know the names aren't great and will be changing to our agreed IA

#190569 Edited, Apr 12, 2018 10:35
  • Member since: 2011
     

    Yes you can.

    Check out https://leanpub.com/epicommercerecipes/read_sample 

    Problem 1.5: Remove the catalog name from product url

    #190570 Apr 12, 2018 10:47
  • Member since: 2010
     

    Thanks Quan, I think I actually read this a while ago but for the life of me couldn't remember where it was. I'll have a look at this, FYI do you know if it's on the roadmap to be able to create our own models for the top "Catalog" node? It would be great if we could extend this class to create our own

    #190571 Apr 12, 2018 10:51
  • Member since: 2011
     

    We don't have a roadmap just yet, and it can be quite complicated to implement because of the underlying datastructure. What are the business scenarios when you need to extend CatalogContent? 

    #190573 Apr 12, 2018 10:55
  • Member since: 2010
     

    As far as I undetstand the type of "Catalog" under tha root is designed for multiple catalogues and in this scenario each one of these might be it's own shop/product listing on the front end of the website. With all the other types you obviously create models with properties and we have core properties and a core ContentArea we add to evey type that ends up rendering as a page (common blocks, seo properties, social properties).

    As the type under the root is locked down to a type we can't extend it's impossible to out of the box support any of this with multiple catalogs without doing what I've done and made these different catalog nodes under a common catalog instead.

    I guess it just seems to me that that the root catalog should have the same flexibiliy of creating models and adding properties under the root as the CMS and site pages has without needing to change the routing and store them as nodes.

    Unless I'm understanding their purpose wrong?

    #190576 Apr 12, 2018 11:02
  • Member since: 2011
     

    I answered that last week IIRC. There is nothing prevents you to return a CMS page for a catalog content - which would be an easy implementation and have superior editing capabilities. 

    #190577 Apr 12, 2018 11:08
  • Member since: 2010
     

    Sorry I'm not sure I follow there, all I want is the flexibility to define the top level node under the "Catalog Root" using C# Models as we do with NodeContent, ProductContent, VariationContent.

    We already have everything working in commerce to support shared view model builders across our base types for type that inherit PageData, NodeContent, ProductContent, VariationContent that currently end up as rendered pages on the website. If we could model the "Catalog" node and create different types we could add these properties on here too so we always a consisten approach.

    #190578 Apr 12, 2018 11:17
  • Member since: 2011
     

    Check out Problem 1.6.3: Beyond multiple sites 

    #190579 Apr 12, 2018 11:24
  • Member since: 2010
     

    What I'm confused about in your example is the selection off the "Catalogue Root" node that show "New Catalog" seems restricted in code to "CatalogContent".

      [CatalogContentType(AvailableInEditMode = false, DisplayName = "Catalog Root", GUID = "c57885b5-c74c-4467-9ebf-4e56764dcb75")]
      [AvailableContentTypes(Include = new Type[] {typeof (CatalogContent)})]
      [CLSCompliant(false)]
      public class RootContent : NodeContentBase

    How would the LandingNode in your example show as an allowed type on the "Catalogue Root"?

    #190581 Apr 12, 2018 11:35
  • Member since: 2010
     

    I think I'll have to get your book, it's good some great info in :-)

    #190582 Apr 12, 2018 11:38
  • Member since: 2010
     

    Hi again, I've implemented Problem 1.5: Remove the catalog name from product url as you suggested and routing is working however the generated URLs from the UrlResolver are still getting the wrong path. Does this require implementing our own hierarchical router as in 1.6.2?

    #190583 Apr 12, 2018 12:05
First   1 2   Last