在 SilverStripe 中的页面名称前添加一个参数 3.x

Adding a parameter before the page name in SilverStripe 3.x

我已经在网上搜索了几个小时,但找不到任何可以回答我查询的内容。

如果我的站点树中有页面:

然后我会通过访问访问这些页面:

如何设置路由才能访问如下页面?

其中 client1、client2 等是一个变量值,将用于标识客户以进行品牌推广等。

您可以使用其中一个模块

或创建类似于 "ClientLanding" 页面类型的东西,您可以在其中 select 一个主题,进行客户端特定设置,例如。

以防其他人遇到这个问题,经过大量谷歌搜索,我终于弄明白了。

我需要将此添加到我的 config.yml

---
Name: modelascontrollerroutes
After: cms/routes#modelascontrollerroutes
---
Director:
  rules:
    '': 'RootURLController'
    '$Client': 'RootURLController'
    '$Client/$URLSegment//$Action/$ID/$OtherID': 'ModelAsController'