I would be working to brand a sharepoint 2013 foundation site. I know Design Manager and all other branding goodies don't exist with SPF 2013. What would be the best approach to brand a simple SPF site. Also no design view in SharePoint designer :(
3 Answers
Trial and error my friend. However, knowing HTML and CSS combined with Sharepoint Designer...when working with SPF 2013 is in my opinion all you need. I'm pretty much on the same boat as you.
Here are some links I found and will share relative to branding:
This is good to understand what css class does what
Just to save you the headache I'll also tell you that it is advised to load in your custom css AFTER sharepoint's css file in the master page. So what it looks like for me is this:
<SharePoint:CssRegistration name="point to your css file/custom.css" After="corev15.css" runat="server" />
I'm sure there is other stuff that I can't think right now. All in all, have fun. It will frustrate the hell out of you at first but there is always a way. The experts on here have been helpful to me, I'm sure they'll be to you too.
Have fun branding :D
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!
-
1Hi Frederik and welcome to SP.SE! Normally we do not approve answers that are so dependent on a link as yours. The reason behind this is that if the link breaks, your answer will be of little help to future readers. Can you please add the details from your blog to your post? Off course you can have a clearly visible link to your blog as a source :) Commented Jan 14, 2014 at 7:20
-
Hi, sorry for that, did not know. I will try and describe it better here, but cant post the full post here as it lost of images, code and text in the tutorial. Ill do my best :-) Commented Jan 14, 2014 at 22:03
-
-
1It's not possible to use
$SPUrl
in SharePoint Foundation due to limitations. Please, revise your answer. Commented Feb 12, 2014 at 19:28 -
Mariusz or Frederik. I'm using SP Foundation. I get the error about $SPUrl. How would I write the CSS registration properly for where we've put the files in your guide?– spex5Commented Sep 8, 2014 at 17:01
have not tried these solutions yet, but it looks like they add publishing features to Foundation http://spf2013publishing.codeplex.com/ 2013 migration of the 2010 version https://mundpublishingfeatur.codeplex.com/ 2010 version