首页 > 解决方案 > 向 Spartacus 添加自定义页面

问题描述

可能我的问题有点愚蠢,因为有很多关于路由的文档。问题是,我不是角度专家,所以我缺少一些上下文。

我想向 spartacus 添加一个自定义子页面(http://localhost:4200/image-upload)。页眉和页脚应该相同。只是内容应该是一个上传表单。

我在哪里以及如何配置路由?

标签: spartacus-storefront

解决方案


  1. 在 CMS 中添加一个带有页面标签的新内容页面/image-upload(带有前导斜杠)。Spartacus 路由应该处理它 OOTB。https://sap.github.io/cloud-commerce-spartacus-storefront-docs/adding-and-customizing-routes/
  2. 仅当您的页面具有自定义布局时才添加布局配置https://sap.github.io/cloud-commerce-spartacus-storefront-docs/page-layout/#configuring-the-layout
  3. 实现应出现在此页面上的 Angular CMS 组件并配置从 CMS 组件类型到实现的映射https://sap.github.io/cloud-commerce-spartacus-storefront-docs/customizing-cms-components/#page-title

推荐阅读