The CMS in SAP Commerce Cloud comes with the concept of three special page types: Product Page, Category Page, Catalog Page (Catalog is not supported for now) and one common type Content Page used for all other pages, i.e. login, order history or faq.
Catalog page目前暂时不支持。
Content page:起万金油作用,用于渲染登录页面,订单历史和FAQ等等。
Spartacus针对这三种页面的route配置:
route with :productCode param - for Product Pages
route with :categoryCode param and route with :brandCode param - for Category Pages
wildcard ** route - for all other, Content Pages
product page的url可以在Spartacus里定制:
routing: {
routes: {
product: {
paths: ['jerryproduct/:productCode/:name', 'jerryproduct/:productCode'],
},
},
},
Content Pages have a configurable URL in the CMS, called page label.
路由配置方式:
All routes in Spartacus can be configured by importing ConfigModule.withConfig() with an object containing routing property:
ConfigModule.withConfig({
routing: { /* ... */ },
/* ... */
})
1
2
3
4
Spartacus默认路由配置,位于default-routing-config.ts里: