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-
This issue refers to the “1 comment
s” text within the blog post preview default transformation (e.g. cms.blog.PostPreview). The “s” letter apparently resides here - the linguistic aspect is not preserved.
Therefore, if you want to display this text correctly, you can either
create a custom function to transformation or even more easily use the IfCompare built-in function which does it for you:
<%# IfCompare(BlogFunctions.GetBlogCommentsCount(Eval("DocumentID"),Eval("NodeAliasPath")), 1, "comments","comment") %>
Links to other resources:
Transformations documentation
-ov-
This error message might appear if you have previously deleted the CMS.Blog document type and try to publish any document in Kentico CMS version 4.0. This issue is caused by bug in Kentico CMS version 4.0. We are very sorry for this inconvenience. We will try to fix it in version 4.1. In a meantime please try to create new document type with name 'CMS.Blog' to avoid the issue.