spartacus-storefront - 向 Spartacus 添加自定义页面
问题描述
可能我的问题有点愚蠢,因为有很多关于路由的文档。问题是,我不是角度专家,所以我缺少一些上下文。
我想向 spartacus 添加一个自定义子页面(http://localhost:4200/image-upload)。页眉和页脚应该相同。只是内容应该是一个上传表单。
我在哪里以及如何配置路由?
解决方案
- 在 CMS 中添加一个带有页面标签的新内容页面
/image-upload
(带有前导斜杠)。Spartacus 路由应该处理它 OOTB。https://sap.github.io/cloud-commerce-spartacus-storefront-docs/adding-and-customizing-routes/ - 仅当您的页面具有自定义布局时才添加布局配置https://sap.github.io/cloud-commerce-spartacus-storefront-docs/page-layout/#configuring-the-layout
- 实现应出现在此页面上的 Angular CMS 组件并配置从 CMS 组件类型到实现的映射https://sap.github.io/cloud-commerce-spartacus-storefront-docs/customizing-cms-components/#page-title
推荐阅读
- python - 找到 max() 后找不到 min(),反之亦然
- java - 如何列出文件夹中以“.dat”结尾的所有文件以及最近的更改(日期时间)
- bash - Unix shell脚本中是否可以进行异常处理,包括在内部调用另一个脚本
- css - 如何扩大输入书写区域?
- android-studio - 您好,有人在您的 Flutter 项目中成功添加了蓝牙 CPCL 吗?
- r - 如何制作具有两个显示比例的分类变量的分组条形图?
- python - 过滤包含非 ascii 值的 pandas 数据帧行
- python - datetime.strptime 给了我错误的月份
- python - 如何在两个函数中传递一个值而不显示错误?
- webstorm - JetBrains 如何在 WebStorm IDE 上打开多项目