zl程序教程

您现在的位置是:首页 >  其他

当前栏目

SAP Spartacus的页面类型和路由配置

SAP路由配置 类型 页面 Spartacus
2023-09-14 09:02:54 时间

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: { /* ... */ },
    /* ... */
})

Spartacus默认路由配置,位于default-routing-config.ts里:



更多Jerry的原创文章,尽在:“汪子熙”: