我正在尝试从 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 设置上下文吗?