0

我正在尝试从 URL 获取当前类别,例如http://localhost/catalog/discs/c-24/c-92(从 GetNiceUrlForCategory() 生成)。但是当我调用时SiteContext.Current.CatalogContext.CurrentCategory,返回 null。

SiteContext.Current.CatalogContext.CurrentCatalogue并且SiteContext.Current.CatalogContext.CurrentCatalogueGroup不返回 null。

是否有另一个内部调用可以解析 URL 或者我应该自己编写?我可以从 URL 设置上下文吗?

4

1 回答 1

0

检查主机名,看起来它们没有为 localhost 设置

于 2020-01-17T18:18:58.693 回答