SAP Spartacus的site context配置
https://github.com/SAP/spartacus-docs/blob/901d0521dcf4668e2ddc5982947268becd0e66dd/_pages/dev/context-configuration.md
每个CMS site都有一个自己的上下文:
- base site ID,
- allowed languages and default language,
- allowed currencies and default currency.
- configuration of persistence of above attributes in the URL
静态上下文配置
You can configure your application by defining context properties, such as base site, language, and currency. When you append the values of these properties to the storefront URL, the storefront is configured based on these values.
配置代码如下:
export const b2cFeature: FeatureEnvironment = {imports: [B2cStorefrontModule.withConfig({context: {urlParameters: ['baseSite', 'language', 'currency'],baseSite: ['electronics-spa','electronics','apparel-de','apparel-uk','apparel-uk-spa',],},
For example, when you access https://localhost:4200/electronics-spa/en/USD/, the application loads the electronics-spa base site, sets the site language to English (en), and sets the currency to US dollars (USD).
The context properties also set the default values for the language and currency drop-down lists, which you can use to change the context of the storefront dynamically.
Context属性在app.module.ts里定义:
context: {baseSite: ['electronics-spa'],urlParameters: ['baseSite', 'language', 'currency']},
urlparameter的顺序可以自己调:
context: {baseSite: ['electronics-spa', //Selected by default because it is the first element in the list'electronics',],language: ['en'],currency: ['USD'],urlParameters: ['baseSite', 'language', 'currency']},
You can change the structure of the context in the URL by changing the order of the elements in the urlParameters property. For example, if you change the urlParameters property to urlParameters: [‘currency’, ‘language’, ‘baseSite’], then the URL becomes https://localhost:4200/USD/en/electronics-spa/
SAP Spartacus的site context配置相关推荐
- SAP Spartacus的site context配置参数SiteContextParamsService
clone request之前: "https://jerry.eastus.cloudapp.azure.com:9002/occ/v2/electronics-spa/cms/pages ...
- SAP Spartacus B2B table的配置信息的merge原理
以SAP Spartacus b2b unit table的配置信息为例:位于文件units.config.ts里: 运行时,这些配置信息,被merge在table.service.ts的this.c ...
- SAP Spartacus powertools-spa site在Commerce Cloud后台的属性
这个site的前台界面: 该site的base store为powertools,catalog为Powertools product catalog: site channel,B2B 或者 B2C ...
- SAP Spartacus B2B table的配置信息从哪里来?
运行时的table配置: 实现位于table.config.ts里: 以unit table为例,配置的实现在units.config.ts文件里: 运行时的效果: 更多Jerry的原创文章,尽在:& ...
- SAP Spartacus ConfigurationService
位于文件configuration.service.ts内: import { Inject, Injectable, OnDestroy } from '@angular/core'; import ...
- 如何在 SAP Spartacus 里添加自定义页面 - Custom Page
网友提问 Add a custom page to Spartacus I would like to add a custom sub page (http://localhost:4200/ima ...
- SAP Spartacus 的路由配置
Configurable Routing 在单页应用程序中,您可以通过显示应用程序的不同视图来控制用户看到的内容. Spartacus 使用 Angular Router 来处理从一个视图到另一个视图 ...
- user.config.ts文件里定义的配置是如何合并到SAP Spartacus的标准配置里去的
user.config.ts文件里提供的默认配置: userRoutingConfig userCmsConfig userTableConfigFactory - function provideD ...
- SAP Spartacus配置后台Commerce Cloud的位置
SAP Spartacus需要连接后台Commerce Cloud才能工作: Access to XMLHttpRequest at 'https://spartacus-dev0.eastus.cl ...
最新文章
- 修改Tomcat可支持get传参方式的url长度,get形式
- 芝麻信用_别忘查看支付宝芝麻信用分,这些特权别浪费
- php试卷A高质量含答案,php试卷A高质量含答案
- axios请求本地的json文件在打包部署到子目录域名下,路径找不到
- 素数个数(信息学奥赛一本通-T1151)
- bz2005 2005: [Noi2010]能量采集 数学题
- 0编译器详解_C++ typeid关键字详解
- 【面经】我是如何优雅的跳槽的?
- 华为5500v3多路径linux6,CentOS7 DM-Multipath+HUAWEI OceanStor存储多路径配置
- 蒙特卡洛之布丰投针(python实现)
- CA认证过程及https实现方法
- 我的世界服务器怎么无限刷红石,我的世界:生存最需要的5个红石机器!MC大神才能看懂这操作!...
- win7 64位下如何安装配置mysql
- T-test数据分析
- 酒桌上的潜规则,男人必学,女人必知
- CSS中Border(边框)
- 计算机网络原理夏秦课后答案,案例-大学计算机基础西安交通大学.doc
- SpringBoot2.x 自动化生成代码整合Mybatis
- 天正引出标注lisp_CAD中怎么画引出标注?
- 请更换备份电池 pos机_POS机常见问题及处理方法