我正在使用 uCommerce 的默认配置,并且看到 uCommerce 不错的 URL 不支持语言:http://sitename/catalogname/productname/c-XX/p-YY。
我应该怎么做才能在这些 URL 中使用这样的语言:http://sitename/en/catalogname/productname/c-XX/p-YY?
这是配置:
<linkManager defaultProvider="sitecore">
<providers>
<clear />
<add name="sitecore" type="Sitecore.Links.LinkProvider, Sitecore.Kernel" addAspxExtension="false" alwaysIncludeServerUrl="false" encodeNames="true" languageEmbedding="always" languageLocation="filePath" lowercaseUrls="true" shortenUrls="true" useDisplayName="true" />
</providers>
</linkManager>
这是我的使用方法:
public WebshopProduct Map(UCommerceProduct uProduct)
{
ProductCatalog catalog = CatalogLibrary.GetCatalog(25);
IUrlService urlService = ObjectFactory.Instance.Resolve<IUrlService>();
...
var url = urlService.GetUrl(catalog, uProduct) // this returns "/catalogname/productname/c-XX/p-YY"
//And I would like to have "/en/catalogname/productname/c-XX/p-YY"
}