This article will share the steps to create post list in SharePoint team site.By default, post list is available in blog template site.

Table of Contents

Requirement

 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.

Purpose

What is a 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

Code

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

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

<script type="text/javascript">  
    $(document).ready(function() {  
        SP.SOD.executeFunc('sp.js', 'SP.ClientContext', LoadFeature);  
    });  
    
    function ActivateWebFeature(web) {  
       var guid = new SP.Guid('{0d1c50f7-0309-431c-adfb-b777d5473a65}');  
       var featureFef = web.get_features().add(guid, true, SP.FeatureDefinitionScope.farm); }
    function LoadFeature() {  
        context = new SP.ClientContext("http://test.sharepoint.com");  
        var web = context.get_web();  
        //Activate Features  
        ActivateWebFeature(web);  
        context.load(web);  
        context.executeQueryAsync(function() {  
            console.log("Featured activated for Web: " + web.get_serverRelativeUrl());  
        }, function(sender, args) {  
            console.log('Error: ' + args.get_message() + '\n' + args.get_stackTrace());  
        });  
    }  
</script>

  

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