Users can flag a comment as inappropriate. Note that only logged-in users should be able to flag a comment.
Attribute | Description |
---|---|
id | ID of the flag. |
comment | The Comment this flag was made on. |
user | The User (opens new window) for the user who made this flag. |
You can flag a comment using a POST request to an action controller, and the following template code. You must supply a commentId
and siteId
in your form.
<form role="form" method="post" accept-charset="UTF-8">
<input type="hidden" name="action" value="comments/comments/flag">
<input type="hidden" name="siteId" value="{{ comment.siteId }}">
<input type="hidden" name="commentId" value="{{ comment.id }}">
{{ csrfInput() }}
<button type="submit">{{ 'Flag' | t('comments') }}</button>
</form>