Skip to main content
3 of 3
added 3774 characters in body

This may be to advanced, but it is an option. You can brand the sites using Visual Sudio.

And even if you choose to do it with designer, don't mess with the default master page, make a copy! And do your branding on a dev environment if possible, you can mess up allot if you do things wrong.

In short, you need to create a new SP 2013 empty project (Farm solution), map the Layouts folder and add a custom CSS. Then add a module (call it Masterpages) and in that add a copy of your master page (you can download a copy from within you SharePoint site under site settings /master pages and layouts) the file is called seattle.master. In VS replace the elements.xml content with this and then change the name to reflect the name of you master.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="Masterpages" Path="Masterpages" RootWebOnly="TRUE" Url="_catalogs/masterpage">
<File Url="CustomTeamSite.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" >
</File>
</Module>
</Elements>

In the master page you need to add the CSS registration.

<SharePoint:CssRegistration ID="CustomCSS" Name="<% $SPUrl:~sitecollection/_layouts/15/Team.Site.Branding/CustomTeamSite.css?v1 %>" After="corev15.css" runat="server" />

Then you need a feature "scope site" that replace the master page on new sites. The feature need a feature receiver to to that. The code within the receiver looks something like this.

        public override void FeatureActivated(SPFeatureReceiverProperties properties)
    {
        SPSite site = properties.Feature.Parent as SPSite;

        if (site != null)
        {
            SPWeb topLevelSite = site.RootWeb;

            // Calculate relative path to site from Web Application root.
            string webAppRelativePath = topLevelSite.ServerRelativeUrl;
            if (!webAppRelativePath.EndsWith("/"))
            {
                webAppRelativePath += "/";
            }

            // Enumerate through each site and apply branding.
            foreach (SPWeb web in site.AllWebs)
            {
                // Activate the publishing feature for all webs.
                web.MasterUrl = webAppRelativePath + "_catalogs/masterpage/CustomTeamSite.master";
                web.CustomMasterUrl = webAppRelativePath + "_catalogs/masterpage/CustomTeamSite.master";

             
                web.Update();
            }
        }
    }

    
    public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
    {
        SPSite siteCollection = properties.Feature.Parent as SPSite;
        if (siteCollection != null)
        {
            SPWeb topLevelSite = siteCollection.RootWeb;

            // Calculate relative path to site from Web Application root.
            string webAppRelativePath = topLevelSite.ServerRelativeUrl;
            if (!webAppRelativePath.EndsWith("/"))
            {
                webAppRelativePath += "/";
            }

            // Enumerate through each site and apply branding.
            foreach (SPWeb site in siteCollection.AllWebs)
            {
                site.MasterUrl = webAppRelativePath + "_catalogs/masterpage/seattle.master";
                site.CustomMasterUrl = webAppRelativePath + "_catalogs/masterpage/seattle.master";
                site.SiteLogoUrl = string.Empty;
                site.Update();
            }
        }
    }
}

When you activate the feature the site will get your new branding.

As i sad this is in short and you can read more about it on my blog where i have a full tutorial.

http://frederik.se/how-to-brand-sharepoint-2013-team-sites-using-feature-stapling-in-vs/

Good luck!