Sometimes, in a Publishing site, you might want to give users the ability to leave comments on a page such as a news story, but you want the functionality embedded in the publishing page itself, so authors aren’t required to add the Note Board web part to each new page they create. You can do this by embedding the SocialCommentControl to your publishing page, like this:
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=220.127.116.11, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>; <SharePointPortalWebControls:SocialCommentControl runat="server" id="SocialComments"/>
The thing is, when you do this, if there are no comments yet, the control displays a really long disclaimer that reads:
There are no notes posted yet. You can use notes to comment on a page, document, or external site. When you create notes they will appear here and under your profile for easy retrieval. Other people can also view the notes you post. Right click or drag and drop this link to your browser’s favorites or bookmarks toolbar to use notes to comment on external sites. Click here for more information about this and other social networking features in Microsoft SharePoint Server 2010.
Let’s be real; on a publishing site, you don’t need this long discourse. You don’t want to inform users that they can comment all over the place; you just want them to comment on this page. But how do you get rid of the message?
<div> tag that has nothing in it. In the variable that SharePoint outputs to the HTML, it adds all the default text in there.
var __socialCommentInitialData_ctl00_PlaceHolderMain_SocialComments = '\r\n\u003cinput type=\u0022hidden\u0022 \r\n id = \u0022CommentPagingInfo_CurrentPage_ctl00_PlaceHolderMain_SocialComments\u0022\r\n value = \u00221\u0022 \u002f\u003e\r\n \u003cinput type=\u0022hidden\u0022 \r\n id = \u0022CommentPagingInfo_HasNext_ctl00_PlaceHolderMain_SocialComments\u0022\r\n value = \u0022false\u0022 \u002f\u003e\r\n \u003cdiv style=\u0022padding-left:5px;padding-right:5px\u0022\u003e\u003c\u002fdiv\u003e\u003c\u002fdiv\u003e';