Create Post List In SharePoint Team site

In this article I would like to share the steps to create post list in SharePoint team site. By default, post list is available in blog template site.

I got a requirement that a customer needs the post list in the SharePoint team site, but post list template is not available in SharePoint team site. There is a solution to create post list in SharePoint team site by activating the feature.

What is blog post list and why do we need post list?

  • The blog post list is used to share the ideas and information to your organization
  • Mainly blog post lists use Intranet portals
  • We can comment the post and like/unlike the posts
  • It can be created quickly and they often have an informal tone

Here is the code to activate the “Blog content” feature.

Add the below code in content editor webpart or script editor webpart.

  1. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>  
  2. <script type="text/javascript">  
  3.     $(document).ready(function() {  
  4.         SP.SOD.executeFunc('sp.js''SP.ClientContext', LoadFeature);  
  5.     });  
  6.   
  7.     function ActivateWebFeature(web) {  
  8.         var guid = new SP.Guid('{0d1c50f7-0309-431c-adfb-b777d5473a65}');  
  9.         var featureFef = web.get_features().add(guid, true, SP.FeatureDefinitionScope.farm);  
  10.     }  
  11.   
  12.     function LoadFeature() {  
  13.         context = new SP.ClientContext("http://test.sharepoint.com");  
  14.         var web = context.get_web();  
  15.         //Activate Features  
  16.         ActivateWebFeature(web);  
  17.         context.load(web);  
  18.         context.executeQueryAsync(function() {  
  19.             console.log("Featured activated for Web: " + web.get_serverRelativeUrl());  
  20.         }, function(sender, args) {  
  21.             console.log('Error: ' + args.get_message() + '\n' + args.get_stackTrace());  
  22.         });  
  23.     }  
  24. </script>  


The list will be created on your team site, those lists are relevant to the blog feature.

Summary

In this article we have learned how to create a post list in SharePoint team site. Now you can enjoy the blog feature in team sites as well.

X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now