Johannes Engelke
Johannes Engelke

Reputation: 33

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?

Upvotes: 3

Views: 1729

Answers (1)

Krzysztof Platis
Krzysztof Platis

Reputation: 1221

  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

Upvotes: 3

Related Questions