This article presents sample flows for adding and managing conversations on Wix site content.
You can help site visitors discover active conversations by displaying popular comments in a custom widget.
To highlight popular comments:
- Call Query Comments and sort by
replyCount, reactionSummary.total, or voteSummary.netVoteCount.
- Select the comments to feature.
- Call Mark Comment for each selected comment.
- Call Query Comments with a filter for marked comments when refreshing the widget.
- Display the returned comments in the widget.
You can accept comments from site visitors who aren't site members and route their submissions through the site's moderation flow.
To create and moderate a guest comment:
- Identify the app, context, and resource where the comment is submitted.
- Call Create Comment with the comment content, guest display name, and optional
contactDetails.email.
- Check the returned comment's
status. If moderation is required, render the submission as pending and don't display its draft content publicly.
- Retrieve the current comment and its
revision before making a moderation decision.
- Call Moderate Draft Content with
APPROVE or REJECT.
- Refresh the comment using the comment returned by the moderation method.
You can display author categories and personalized reaction state beside a page of comments.
To display comments with author badges and reactions:
- Call List Comments By Resource with
AUTHOR_BADGES in fields.
- Match each member author's ID to
authorBadges.badgesByMemberId. If the author or badge entry is unavailable, render the comment without a badge.
- Collect the returned comment and reply IDs.
- Call Bulk Get Comment Reactions with the IDs and the same app and context.
- Display per-code totals and the current identity's
hasReacted state.
- When the current identity chooses a reaction, call Add Comment Reaction or Remove Comment Reaction.
- Refresh the reaction summary after the change.
You can let site visitors review earlier published versions of a comment.
To display a comment's edit history:
- Retrieve the comment visible to the current identity and collect its ID.
- Call List Comment Content Revisions with the comment ID.
- Follow the returned cursor to retrieve additional revisions.
- Display the revisions in reverse chronological order.