예제 #1
0
        protected virtual JumbotronModel GetModel(Item actionItem)
        {
            var model = new JumbotronModel
            {
                Title           = actionItem["Jumbotron Title"],
                Text            = RenderField(actionItem, "Jumbotron Text"),
                NavigationItems = new NavigationItemModel[0],
            };

            ReferenceField rf = actionItem.Fields["Jumbotron Top Navigation Reference"];

            if (rf?.TargetItem != null)
            {
                var navModel = _navigationRepository.GetModel(rf.TargetItem);
                model.NavigationItems = navModel.TopNavigationLinks;
            }

            return(model);
        }