/// <summary> /// Build /// </summary> /// <returns></returns> public override void Build() { AddLanguageVersion(Rule(c => c.Path.StartsWith("/cs") || c.Path == "/")); AddLanguageVersion(Rule(c => c.Path.StartsWith("/en"))); var landing = new PageModel("landing") { Meets = Rule(c => c.Path == "/" || c.Path == "/en"), }; var articles = new PageModel("article") { Organizer = new HierarchyOrganizer(), Meets = Allways }; var system = new PageModel("system") { FallsThrough = Rule(c => c.Url.SegmentPredicate(2, s => s == "system") && c.Url.SegmentExists(3)) }; var @event = new PageModel("event") { Meets = Allways }; var eventsList = new PageModel("eventList") { Meets = Rule(p => p.Url.LastSegment.StartsWith("aktuality")), FallsThrough = Rule(p => p.Url.LastSegment == "detail") }; eventsList.AddChildren(@event); Hook.AddChildren(landing, articles, system, eventsList); }
/// <summary> /// Page Model /// </summary> /// <param name="pageModel">page Model</param> /// <returns></returns> private PageModel(PageModel pageModel) { this.meetCondition = pageModel.meetCondition; this.fallThroughCondition = pageModel.fallThroughCondition; this.organizer = pageModel.organizer; this.name = pageModel.name; this.PageType = pageModel.PageType; }
/// <summary> /// Clone /// </summary> /// <returns></returns> public PageModel Clone() { var clone = new PageModel(this); clone.Children.AddRange(Children.Select(c => c.Clone())); return clone; }