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裡: