【发布时间】:2014-07-21 02:45:04
【问题描述】:
我正在使用此 Silverstripe 模块创建产品目录:
https://github.com/luisdias/silverstripe-productcatalog 这是基于这个模块 https://github.com/arambalakjian/DataObject-as-Page
我有一个问题,友好的 URL 显示为:www.mysite.com/product-page/category/1 要么 www.mysite.com/product-page/show/1/1 与其标题或 url 段并列。 www.mysite.com/product-page/show/my-category/my-product
我尝试将代码从 Product.php 更改为
//Return the link to view this category
public function Link() {
$Action = 'show/' . $this->ID . '/' . $this->URLSegment;
return $Action;
}
来自
//Return the link to view this category
public function Link() {
$Action = 'show/' . $this->ID . '/' . $this->CategoryID;
return $Action;
}
这有效,但不适用于类别标题,并且 url 有空格,它会生成 %20 而不是 _。
这似乎是一个我无法解决的简单更改..
我还希望能够有子类别。因此,一个类别中的所有内容都可以分为它们的“大小”。目前所有产品只分一次。产品 > 类别 我想要 产品 > 类别 > 子类别 谁能帮我实现这一目标?谢谢
【问题讨论】:
-
Product Catalog 模块不是基于 DataObjectAsPage 模块的。
标签: php friendly-url silverstripe product catalog