> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: onCommentCreated(event: CreatedComment) # Method package: wixForumBackend # Method menu location: wixForumBackend --> Events --> onCommentCreated # Method Link: https://dev.wix.com/docs/velo/apis/wix-forum-backend/events/on-comment-created.md # Method Description: A backend event that fires when a new forum comment is created. The `onCommentCreated()` event handler runs when a new forum comment is created in your site. The received `CreatedComment` object contains information about the new comment that was created. > **Note:** Backend events are **not** fired when previewing your site. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## A backend event that occurs when a new forum comment is created ```javascript // Place this code in a file named events.js // in the Backend section of your code files. export function wixForum_onCommentCreated(event) { const commentId = event.commentId; const commentText = event.comment.plainContent; } /* Full comment object: * { * "_id": "5f88058be9b6b100175b154c", * "postId":"5f88058be9b6b100175b154a", * "_ownerId":"32cf071a-ck2f-450f-ad74-5a25db0b1b6g", * "plainContent": "This is my comment text.", * "replyCount": 0, * "likeCount": 0, * "upvoteCount": 0, * "downvoteCount": 0, * "score": 0, * "_createdDate": "2020-10-26T07:18:20.297Z", * "_editedDate": null, * "_lastActivityDate": "2020-10-26T07:18:20.297Z", * "pageUrl": "/forum/main/comment/5f88058be9b6b100175b154c" * } */ ``` ---