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 probably need to use IsPrimary like in the below code snippt
var nodeRelations = _relationRepository.GetParents<NodeEntryRelation>(entryContentReference).ToList();
var primaryRelation = nodeRelations.FirstOrDefault(x => x.IsPrimary);
if (primaryRelation != null)
{
var thisRelationContentReference = _referenceConverter.GetContentLink(primaryRelation.Parent.ID, CatalogContentType.CatalogNode, primaryRelation.Parent.WorkID);
var nodeContentBase = _contentLoader.Get<NodeContentBase>(thisRelationContentReference);
return nodeContentBase.ContentLink;
}
Hi there,
I have the following catalog three:
When I call _relationRepository.GetParents<NodeRelation>(reference-to-shorts-category).ToList() I was expecting to get a reference to "Men" category since it's the parent and primary category of "Shorts", but it returns a reference to "Pyjama" which is an additional category. Is that correct? Am I doing anything wrong?
Thank you in advance!