MODX。有必要实现该链接,以便英文版本没有前缀 /en/

问题描述 投票:0回答:1

该网站有 3 个版本:西班牙语、乌克兰语和英语,需要以英语版本没有 /en/ 前缀的方式实现这一点 它应该是这样的: https://example.com/terms/ https://example.com/es/terms/ https://example.com/ua/terms/

<ul class="site-footer__bottom-text-two list-unstyled">
    <li>
        <a href="/[[!*context_key:is=`web`:then=`ua`]][[!*context_key:is=`en`:then=`en`]]  [[!*context_key:is=`ru`:then=`ru`]]/terms/">[[%terms? &namespace=`lang` &language=`[[++cultureKey]]`]]</a>
    </li>
</ul>

我可能没有展示所需的所有上下文,但我想了解如何实现这一点。谢谢!

php modx
1个回答
0
投票

看起来默认情况下将使用您的英语上下文,因此您需要进入其设置(yourwebsite.com/manager/?a=context)并确保相应的

路径
中没有/en/前缀设置。另外请检查您的上下文是否已加载到根
index.php
文件中,基本上有
web
上下文调用。另外要小心下一次 MODX 更新,它会使用默认值重写
index.php
,因此您应该意识到这一点并相应地更新文件。

© www.soinside.com 2019 - 2024. All rights reserved.