微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在Sitecore SXA元数据部分设计中使用使用令牌?

如何解决如何在Sitecore SXA元数据部分设计中使用使用令牌?

我在Sitecore SXA元数据部分设计中使用了HTML代码段,以在生成的HTML的头部添加一些链接

enter image description here

此HTML是:

<link rel="stylesheet" href="https://unpkg.com/sxa-umbrella-webcomponents@0.0.1/dist/sxa-umbrella-webcomponents/sxa-umbrella-webcomponents.css" />
<script type="module" src="https://unpkg.com/sxa-umbrella-webcomponents@0.0.1/dist/sxa-umbrella-webcomponents/sxa-umbrella-webcomponents.esm.js"></script>
<script nomodule src="https://unpkg.com/sxa-umbrella-webcomponents@0.0.1/dist/sxa-umbrella-webcomponents/sxa-umbrella-webcomponents.js"></script>

但是我想使用例如令牌来配置基本路径,例如:

<link rel="stylesheet" href="$WebComponentsBasePath/sxa-umbrella-webcomponents.css" />
<script type="module" src="$WebComponentsBasePath/sxa-umbrella-webcomponents.esm.js"></script>
<script nomodule src="$WebComponentsBasePath/sxa-umbrella-webcomponents.js"></script>

令牌设置为:"https://unpkg.com/sxa-umbrella-webcomponents@0.0.1/dist/sxa-umbrella-webcomponents

但是令牌替换在HTML代码段中不起作用。

关于如何使此基本路径可用于元数据部分设计的任何想法,这样我就可以为我的开发环境和生产环境进行不同的配置,并有可能轻松切换生产中的基本路径以前滚版本或回滚基于配置的基本路径使用的文件的版本?

解决方法

您是否考虑为这3个文件创建一个主题并将其包含在您的网站主题中?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。