以编程方式更改SharePoint 2013子网站颜色

时间:2013-10-08 20:37:11

标签: sharepoint master-pages sharepoint-2013 sharepoint-object-model

我有一个主网站集,它使用红色的股票发布网站模板。所有子站点都继承主页面和主题。所有子站点都使用项目站点模板。我正在使用服务器对象模型创建它们。所有子站点在创建后都是标准蓝色。我怎么能强迫他们变红?

    static void SetupNewSubSite(int currentYear, SPItemEventProperties properties, int siteIndexId)
    {
        string description = properties.AfterProperties["Project_x0020_Description"].ToString();
        SPListItem CurrentItem = properties.ListItem;
        String subSiteUrl = Convert.ToString(siteIndexId);
        SPSite projectSiteCollection = new SPSite(properties.Web.Site.Url + "/" + currentYear);           
        SPWeb sWeb = new SPSite(properties.SiteId).OpenWeb(properties.RelativeWebUrl);            
        SPWeb oWeb = projectSiteCollection.RootWeb;
        SPWebCollection cWebs = oWeb.Webs;
        SPWeb xWeb = cWebs.Add(subSiteUrl, properties.AfterProperties["Title"].ToString(),
        properties.AfterProperties["Project_x0020_Description"].ToString(), 1033, "{B5B6BDD1-485A-44BC-B093-F1048271C49D}", false, false);
    }

0 个答案:

没有答案