Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update introduction for wix-comments-v2 #2331

Merged
merged 1 commit into from
Aug 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions wix-comments-v2/wix-comments-v2/Comments/guides/comments-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,26 @@ To use the Comments API, import { comments } from the `wix-comments.v2` module:
import { comments } from `wix-comments.v2`;
```

## Moderation
With user-generated content a site owner might want to enable moderation settings to ensure a respectful and appropriate environment. It allows site owners to review and filter comments before they are publicly visible, to prevent spam, offensive language, or inappropriate content from being published. Additionally, moderation settings can help maintain the overall quality of discussions and foster a positive community experience for all participants.

Currently, moderation settings are only available in a site owner's [dashboard](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fblog/settings), not through the API. For more information, see [Customizing a forum’s moderation settings](https://support.wix.com/en/article/wix-forum-moderating-your-forum#customizing-the-moderation-settings) and [Enabling comments for a specific blog post](https://support.wix.com/en/article/wix-blog-managing-comments-for-your-posts#enabling-comments-for-a-specific-post).

## Integrations
The Comments API is fully integrated with several Wix solutions. Each integration uses a slightly different configuration to work with Comments.

The following table details the currently supported integrations:
| Wix App | `appId` | `contextId` | `resourceId` |
| --- | --- | --- | --- |
| Wix Blog | 91c9d6a7-6667-41fb-b0b4-7d3b3ff0b02e | `categoryId` | `componentId` |
| Wix Comments | 14bcded7-0066-7c35-14d7-466cb3f09103 | `contentId` | `contentId` |
| Wix Blog | 14bcded7-0066-7c35-14d7-466cb3f09103 | `internalId` | `internalId` |
| Wix Comments | 91c9d6a7-6667-41fb-b0b4-7d3b3ff0b02e | `contentId` | `contentId` |
| Wix Forum | 14724f35-6794-cd1a-0244-25fd138f9242 | `forumPostId` | `forumPostId` |
| Wix Groups | 148c2287-c669-d849-d153-463c7486a694 | `groupId` | `feedItemId` |

## Use cases
+ Highlight popular comments in a widget
+ Provide comment analytics

## Terminology
+ **Marked comments:** When a comment's `marked` field is set to `TRUE`, it indicates that the comment has been flagged or marked for special attention. No additional automated behavior or action is taken with the comment. However, you can manually filter for comments marked as such with the [`queryComments()`](#querycomments) function and highlight them to your visitors as needed.
+ **Marked comments:** When a comment's `marked` field is set to `TRUE`, it indicates that the comment has been flagged or marked for special attention. No additional automated behavior or action is taken with the comment. However, you can manually filter for comments marked as such with the [`queryComments()`](wix-comments-v2/comments/querycomments) function and highlight them to your visitors as needed.
+ **Parent comments:** Parent comments refer to comments that have subsequent comments directly responding to them. They serve as the original or initial comments in a conversation thread. The parent comment's unique identifier is stored in the `parentComment.id` field of the corresponding reply comment.
+ **Replies:** Replies are comments that are made in direct response to earlier comments within a discussion. They are specifically intended as responses to a particular parent comment and contribute to the ongoing conversation. Replies help maintain the hierarchical structure of comment threads and enhance the engagement and interactivity among users.

## Permissions information

Functions in Comments API are restricted and only run if you elevate permissions using the `wix-auth` [`elevate()`](https://www.wix.com/velo/reference/wix-auth/elevate) function.

<blockquote class='warning'>
<p><strong>Warning:</strong> Elevating a function allows it to be called by any site visitor. Exercise caution to prevent security vulnerabilities.</p>
</blockquote>