示例#1
0
        private static void SetCurrentCategoryRelation(IModelTransformContext context, PropertyDictionary properties, IFacetContent source)
        {
            ContentReference currentCategoryLink;

            if (ContentReference.TryParse(context.QueryParameters.AllParameters["currentCategory"], out currentCategoryLink))
            {
                properties["IsRelatedToCurrentCategory"] =
                    source.NodeLinks != null &&
                    source.NodeLinks.Any(link => link.CompareToIgnoreWorkID(currentCategoryLink));
            }
            else
            {
                properties["IsRelatedToCurrentCategory"] = true;
            }
        }
示例#2
0
        private static void SetHasChildrenForEntryContent(IModelTransformContext context, IFacetContent source)
        {
            var structureStoreContentDataModel = context.Target as StructureStoreContentDataModel;

            if (structureStoreContentDataModel == null)
            {
                return;
            }

            structureStoreContentDataModel.HasChildren = source.VariationLinks != null && source.VariationLinks.Any();
        }