Created
May 15, 2016 16:18
-
-
Save casper-rasmussen/e4c27f118027e7845f053d9ff5b59fd6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override CatalogContentBase FindNextContentInSegmentPair(CatalogContentBase catalogContent, SegmentPair segmentPair, SegmentContext segmentContext, CultureInfo cultureInfo) | |
{ | |
CatalogContentBase currentCatalog = base.FindNextContentInSegmentPair(catalogContent, segmentPair, segmentContext, cultureInfo); | |
if (_segments.Contains(segmentPair.Next, StringComparer.InvariantCultureIgnoreCase)) | |
{ | |
//Let's tell Episerver to route to parent product | |
var parentProduct = this._contentLoader.GetBySegment(catalogContent.ParentLink, segmentContext.LastConsumedFragment, cultureInfo) as CatalogContentBase; | |
return parentProduct; | |
} | |
return currentCatalog; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment