How to display URLs of blog comments in the CMS Desk

HelenaG Grulichova asked on April 26, 2012 06:07

How to display URLs of blog comments in the CMS Desk

Correct Answer

HelenaG Grulichova answered on April 26, 2012 06:07

If you want to display the URL address of a blog post which is related to a comment in CMS Desk -> My desk -> Blogs -> Comments, please open the ~\CMSModules\Blogs\Tools\Comments_List.xml file and add an extra column into it:

<column source="CommentPostDocumentID" externalsourcename="PostDocument" caption="$general.url$" wrap="false">
</column>


The comment grid is now prepared to show URLs, but you need to fill that new column with the correct data, so please edit the ~\CMSModules\Blogs\Controls\Blogs_Comments.ascx.cs file and update the line 233:

gridComments.Columns = "CommentID, CommentDate, CommentApproved, CommentUserName, CommentText, CommentIsSpam, CommentPostDocumentID";


Finally you can get a document’s URL from its ID by adding an extra case into the gridComments_OnExternalDataBound() method in the same file:

case "postdocument":
return CMS.CMSHelper.CMSContext.GetDocumentUrl(ValidationHelper.GetInteger(parameter, 0));
-jh-
0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.