onCategoryUpdated( )


A backend event that fires when a forum category is updated.

The onCategoryUpdated() event handler runs when a an existing forum category in your site is updated. The received UpdatedCategory object contains information about the category that was updated.

Note: Backend events are not fired when previewing your site.

Method Declaration
Copy
function onCategoryUpdated(event: UpdatedCategory): void;
Method Parameters
eventUpdatedCategoryRequired

Information about the forum category that was updated.

In this example, the category header background is an image.

JavaScript
// Place this code in a file named events.js // in the Backend section of your code files. export function wixForum_onCategoryUpdated(event) { const categoryId = event.categoryId; const categoryName = event.category.name; } /* Full category object: * { * "_id": "5f88058be9b6b100175b154d", * "name": "My Updated Category Name", * "headerTitle": "My Updated Category Header Title", * "description": "This is a description of my category.", * "headerType": "IMAGE", * "headerImage": "wix:image://v1/a27d24_3...46~mv2.jpg/_.jpg#originWidth=940&originHeight=529", * "headerImageOverlayColor": { * "color": "#40E0D0", * "opacity": 0.1 * }, * "rank": 2, * "slug": "my-updated-category-name", * "pageUrl": "/forum/my-updated-category-name", * "postCount": 3, * "postViewCount": 56, * "writeProtected": "true", * "_createdDate": "2020-10-26T07:18:20.297Z", * "_updatedDate": "2020-11-04T12:27:05.592Z" * } */
Did this help?

onCommentCreated( )


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 Declaration
Copy
Method Parameters
eventCreatedCommentRequired

Information about the forum comment that was created.

A backend event that occurs when a new forum comment is created
JavaScript
Did this help?

onCommentDeleted( )


A backend event that fires when a forum comment is deleted.

The onCommentDeleted() event handler runs when an existing forum comment in your site is deleted. The received DeletedComment object contains information about the comment that was deleted.

Note: Backend events are not fired when previewing your site.

Method Declaration
Copy
Method Parameters
eventDeletedCommentRequired

Information about the forum comment that was deleted.

A backend event that occurs when a forum comment is deleted
JavaScript
Did this help?

onCommentDownvoted( )


A backend event that fires when a forum comment is downvoted.

The onCommentDownvoted() event handler runs when an existing forum comment in your site is downvoted. The received DownvotedComment object contains information about the comment that was downvoted.

Notes:

  • Only comments on posts with a postType of "QUESTION" can be voted on.

  • Backend events are not fired when previewing your site.

Method Declaration
Copy
Method Parameters
eventDownvotedCommentRequired

Information about the forum comment that was downvoted.

A backend event that occurs when a forum comment is downvoted
JavaScript
Did this help?