List View row Formatting: Discussion Board

Hi Friends,

I have seen that in on-prem many of the users are using the discussion feature, but in SharePoint Online we do not have this feature. To give it a thought I have implemented somewhat similar functionality.


Discussion board formatting gives the ability to showcase the discussion which is a page, under specific category which will make more sense to the discussion board. So, whatever category you want to create, create the folder for that and the corresponding pages beneath it.

This discussion board formatted displays the banner image (not the thumbnail image) and showcases it in the front along with the title, description, Likes, Comments, Date of last edit, and the owner of the page(not the author).

No new column needs to be created only the existing column needs to be added to the view. For that execute the below PnP code


# If want to modify the existing view
Set-PnPView -List "Site Pages" -Identity "<Name of the view>" -Fields "Modified",
"_CommentCount","Description","ID","_LikeCount","BannerImageUrl","_AuthorByline","Title"

# If want to create a new view
Add-PnPView -List "Site Pages" -Title "Discussion Board" -Fields "Modified","_CommentCount",
"Description","ID","_LikeCount","BannerImageUrl","_AuthorByline","Title"


The above PnP code will add all the necessary columns to the view. Now paste the JSON in the formatter.

Code can be found here

List View row Formatting: Discussion Board




Hope this will help you.


Happy Coding..!!
#Microsoft #RowFormatting #SharePointWidgets






Comments

  1. Hello Sumit,
    The above solution is quite interesting, could you elaborate the lookup colums to what they reference

    ReplyDelete
    Replies
    1. For _LikeCount and _CommentCount are the OOB fields, which Microsoft uses to keep the count of the likes and comments against each page. Both of the fields are hidden so you need to add them to the view using Powershell. Hope I have answered your question. Please let me know if this is not what you want to know.

      Delete
    2. Thanks a lot for the clarification ,it worked properly and this solution can replace the existing on prem discussion board application

      Delete

Post a Comment

Popular posts from this blog

Rename Folder using Microsoft Flow / Power Automate in a Document Library in SharePoint Online

Power Automate: How to Add "New Line" to the text in SharePoint multiline text field

Power Automate: Rename file in SharePoint Online