Search code examples
spartacus-storefront

Add a custom page to Spartacus


Probably my question is a bit dumb as there is a lot of documentation about routing. The problem is, I am not an angular specialist, so I am missing a bit of context.

I would like to add a custom sub page (http://localhost:4200/image-upload) to spartacus. The Header and Footer should be the same. Just the content should be an upload form.

Where and how do I configure the route?


Solution

    1. Add a new content page in CMS with page label /image-upload (with the leading slash). Spartacus routing should handle it OOTB. https://sap.github.io/cloud-commerce-spartacus-storefront-docs/adding-and-customizing-routes/
    2. Add a layout config only if your page has custom layout https://sap.github.io/cloud-commerce-spartacus-storefront-docs/page-layout/#configuring-the-layout
    3. Implement Angular CMS components that should appear on this page and configure mapping from CMS component type to the implementation https://sap.github.io/cloud-commerce-spartacus-storefront-docs/customizing-cms-components/#page-title