Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
You can certainly add a cache to that, can be as simple as a Dictionary<string, ContentReference>().
There is no "normalized" code support in Episerver.
And I think you might be referring to UrlSegment (aka name in url), not code.
Hi Quan,
Can i use ProjectionsSearch to get ProductContent type?
I try use projection but i get exception messeage: Please use GetContentResult extension method for getting results with content types
When i try use GetcontentResult i can't get value of properties set as Ignore attribute
For example:
[Ignore]
public IEnumerable<PriceRange> Prices
{
get; set;
}
[Ignore]
public IEnumerable<ProductAvailability> ProductAvailabilities { get; set; }
Thanks,
Thang Le
Hi,
I am using product code in url but my code not startdard it include some special characters. So i have to normalize it and then add to url
from normalize code in url i can't denomalize to actual code to get product by ContentRepository so i have to query to episerver FIND to get product
The issue is that, time to query to find to get product too long lead to performance impact
//incoming protected override CatalogContentBase FindNextContentInSegmentPair(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) { while (!string.IsNullOrWhiteSpace(segmentPair.Next) && segmentContext.RequestUrl.IsAbsoluteUri && segmentContext.RequestUrl.AbsolutePath.Contains("/product/")) { if (catalogContent.ContentType == CatalogContentType.Root) { var code = $"{Constants.ARTICLE_PREFIX}_{segmentPair.Next}"; // Performance issue here var singleProduct = _queryService.FindProductByNormalizeCode(code, _currentMarket.GetCurrentMarket().MarketId.Value); if (product != nul) { if (contentLoader.TryGet(contentLink, out ProductContent product)) { return product; } return singleProduct; } } segmentContext.RemainingPath = string.Empty; segmentPair = segmentContext.GetNextValue(segmentPair.Remaining); } return base.FindNextContentInSegmentPair(catalogContent, segmentPair, segmentContext, cultureInfo); }
So my question:
Is there any way to get product by nomalize code from episerver
Thanks,
Thang Le