public void Deploy_TopNavigation()
        {
            // Step 1, define top navigation nodes
            var home = new TopNavigationNodeDefinition
            {
                Title      = "Home",
                Url        = "/",
                IsExternal = false
            };

            var google = new TopNavigationNodeDefinition
            {
                Title      = "Google",
                Url        = "http://google.com",
                IsExternal = true
            };

            // Step 2, define web model and artifact relationships - add feature to the web
            var model = SPMeta2Model
                        .NewWebModel(web =>
            {
                web
                .AddTopNavigationNode(home)
                .AddTopNavigationNode(google);
            });

            // Step 3, deploy model
            DeployWebModel(model);
        }
        //[SampleMetadataTag(Name = BuiltInTagNames.SampleHidden)]
        public void CaDeployFlatTopNavigation()
        {
            var ourCompany = new TopNavigationNodeDefinition
            {
                Title      = "Our Company",
                Url        = "our-company.aspx",
                IsExternal = true
            };

            var ourServices = new TopNavigationNodeDefinition
            {
                Title      = "Our Services",
                Url        = "our-services.aspx",
                IsExternal = true
            };

            var ourTeam = new TopNavigationNodeDefinition
            {
                Title      = "Our Team",
                Url        = "our-team.aspx",
                IsExternal = true
            };

            var model = SPMeta2Model.NewWebModel(web =>
            {
                web
                .AddTopNavigationNode(ourCompany)
                .AddTopNavigationNode(ourServices)
                .AddTopNavigationNode(ourTeam);
            });

            DeployModel(model);
        }
Esempio n. 3
0
 public static TModelNode AddTopNavigationNode <TModelNode>(this TModelNode model, TopNavigationNodeDefinition definition,
                                                            Action <TopNavigationNodeModelNode> action)
     where TModelNode : ModelNode, ITopNavigationNodeHostModelNode, new()
 {
     return(model.AddTypedDefinitionNode(definition, action));
 }
Esempio n. 4
0
 public static TModelNode AddTopNavigationNode <TModelNode>(this TModelNode model, TopNavigationNodeDefinition definition)
     where TModelNode : ModelNode, ITopNavigationNodeHostModelNode, new()
 {
     return(AddTopNavigationNode(model, definition, null));
 }
        //[SampleMetadataTag(Name = BuiltInTagNames.SampleHidden)]
        public void CaDeployHierarchicalTopNavigation()
        {
            // top level departments node
            var departments = new TopNavigationNodeDefinition
            {
                Title      = "Our Departments",
                Url        = "our-departments.aspx",
                IsExternal = true
            };

            var hr = new TopNavigationNodeDefinition
            {
                Title      = "HR Team",
                Url        = "hr-team.aspx",
                IsExternal = true
            };

            var it = new TopNavigationNodeDefinition
            {
                Title      = "IT Team",
                Url        = "it-team.aspx",
                IsExternal = true
            };

            // top level clients node
            var partners = new TopNavigationNodeDefinition
            {
                Title      = "Our Partners",
                Url        = "our-partners.aspx",
                IsExternal = true
            };

            var microsoft = new TopNavigationNodeDefinition
            {
                Title      = "Microsoft",
                Url        = "microsfot.aspx",
                IsExternal = true
            };

            var apple = new TopNavigationNodeDefinition
            {
                Title      = "Apple",
                Url        = "apple.aspx",
                IsExternal = true
            };

            var model = SPMeta2Model.NewWebModel(web =>
            {
                web
                .AddTopNavigationNode(departments, node =>
                {
                    node
                    .AddTopNavigationNode(hr)
                    .AddTopNavigationNode(it);
                })
                .AddTopNavigationNode(partners, node =>
                {
                    node
                    .AddTopNavigationNode(microsoft)
                    .AddTopNavigationNode(apple);
                });
            });

            DeployModel(model);
        }
Esempio n. 6
0
 public static ModelNode AddTopNavigationNode(this ModelNode model, TopNavigationNodeDefinition definition, Action <ModelNode> action)
 {
     return(model.AddDefinitionNode(definition, action));
 }
Esempio n. 7
0
 public static ModelNode AddTopNavigationNode(this ModelNode model, TopNavigationNodeDefinition definition)
 {
     return(AddTopNavigationNode(model, definition, null));
 }