Typically when you want a blog in SharePoint, you need to create a new site collection or a subsite using the Blog site template.
Sometimes it would just be easier (or nice) to have a blog right in another site such as a team site or departmental site without the need for yet another site collection or subsite to maintain. No problem.
You can easily add a blog to an existing site using PowerShell. Fire up the SharePoint 2013 Management Console and enter the following command:
Enable-SPFeature -identity "BlogContent" -url <<the url of the site>>
Next, navigate to the site in the browser and edit the home page:
From the Insert tab on the top ribbon, click on Web Part:
Select Posts from the Apps category and click on the Add button:
The blog posts now appear on your home page:
Click on the sample blog post:
You now have a blog in your existing site without having a separate subsite!
very nice and easy to use
ReplyDeletenice tips ...
ReplyDeletethank you =)
While this is cool, what is the use case for this?
ReplyDeleteIf you want to have a blog within a site without having to go to a different url.
DeleteBetter late than never, right?
ReplyDeleteAnyway, this is exactly what I'm trying to do (Sharepoint neophyte!), but with SharePoint online. Do you know if this is possible?
There does not appear to be a cmdlet equivalent for enable-spfeature in the SPO Powershell library that I can find.
I haven't been in the online world in awhile. Maybe it's time to dive back in. I don't remember seeing too many SPO cmdlets. Hopefully they'll expand this. I am assuming the javascript object model is available. Maybe yoy can hack it that way. I'll take a look.
DeleteYep! You can do something similiar to this: http://blogs.msdn.com/b/kaevans/archive/2013/10/05/enabling-the-developer-site-collection-feature-in-sharepoint-online.aspx
DeleteI'll get you the feature guid.
I'm also interested in this - how would I transition from enabling the developer site collection in SP Online to the directions you list above?
DeleteHi Steve, I've been trying to get the O365 Client Browser to work. I was able to get the GUID already but I can't seem to enable it that easily.
ReplyDeleteWould you know how I can enable it using Client Browser?
You can't enable through the browser. You would have to do something similar as in the blog post I mentioned in the previous comment.
DeleteYou can run CSOM javascript to enable the Blog feature for SharePoint online.
ReplyDeletefunction ActivateWebFeature(web) {
var guid = new SP.Guid('{0d1c50f7-0309-431c-adfb-b777d5473a65}');
var featDefinition = web.get_features().add(guid, true, SP.FeatureDefinitionScope.farm);
}
var context = new SP.ClientContext.get_current();
var web = context.get_web();
//Activate Features
ActivateWebFeature(web);
context.load(web);
context.executeQueryAsync(
function () {
window.console && console.info("Featured activated for Web: " + web.get_serverRelativeUrl());
},
function (sender, args) {
window.console && console.info('Error: ' + args.get_message() + '\n' + args.get_stackTrace());
}
);
Thank you for this post!!! Used it to add Blogging tools to a community site in SPO
DeleteYes! Thanks!
ReplyDeleteThere is a problem with this solution: after enabling the blog feature, 'save this site as template' no longer works - the procedure returns error - and even if you try to disable the feature the error persist. Anyone who faced it and resolved somehow?
ReplyDeleteYou can set the SaveSiteAsTemplateEnabled property to "true" on the SPWeb object to get back the Save Site As a Template link in Site Settings:
DeletePowershell:
$web = Get-SPWeb http://mysharepoint/web
$web.AllProperties["SaveSiteAsTemplateEnabled"] = "true"
The problem isn't the visibility of the link, but the fact that the saving procedure gives error. Even after disabled the blog feature.
DeleteWith the summary view, I noticed that the href value of the post is blank. This makes the item link to the document library where the home page resides, and not to the proper post item.
ReplyDeleteDo you know of any way to make the items link to the proper item? Other than writing some javascript, I am at a loss as to where the Posts Web part Summary View gets that URL... something in the SPWeb property bag maybe?
I figured it out. You need to have the "Blog Tools" web part on the same page. The Posts web part and the Blog Tools web part work together. Not very intuitive, but we really aren't supposed to have the blog stuff on a site other than a blog site.
ReplyDeleteThe good news is that if you are not a contributor to the site, the Blog Tools web part is hidden.
Wonderful post however I was wondering if you could write a little more on this topic? I’d be very thankful if you could elaborate a little bit further. Thank you!
ReplyDeleteSharePoint Online
great post....! Thank you Steve.
ReplyDeleteHello.
ReplyDeleteThank you for the wonderfull Post. I am unable to Enable Blog Content Query. I get following error:
Enable-SPFeature: The Feature is not a Farm Level Feature and is not found in a Site level defined by the Url....
I will be so appreciate if someone could help me.
Hi! Great and helpful post! Thanks!
ReplyDeleteI try this for community site and got a little trouble: community feature and blog feature both use a Categories list. And when I activate blog feature it try to create/update Categories list. After that Categories list does not work properly.
It's like an "Getting Error Message for Exception Microsoft.SharePoint.SPException: Cannot complete this action. Please try again." error, when I open a Categories list.
I clear it with disabling blog and community features, delete all of these features content(lists) and activate blog feature again.
I hope this can help to anyone.
Sorry for my bad English :)
Have the exact same issue. Which is odd - blogs and community sites should go hand and hand. I am guessing the Blog Feature that gets enabled wants to overwrite the categories, but isn't able to, and things get weird from there.
DeleteGood Job
ReplyDelete