Integrate a comment form

Below is an example of how to set up a commenting form in Bootstrap 4.


{# @var commentsWork \twentyfourhoursmedia\commentswork\services\CommentsWorkService #} {% set commentsWork = craft.commentsWork.service %}

{% if not currentUser and not commentsWork.allowAnonymous(entry) %}

Anonymous commenting is not allowed. Please login.

{% else %}
Leave a comment
{{ csrfInput() }} {{ signCommentForm(entry) }}
            <div class="form-group">
                <label for="comment-title">Title</label>
                <input name="title" id="comment-title" type="text" class="form-control"/>
            </div>
            <div class="form-group">
                <label for="comment-content">Comment</label>
                <textarea name="comment" rows="5" id="comment-content" class="form-control"></textarea>
            </div>

            <div>
                <input type="submit" class="btn btn-primary" value="Post comment"/>
            </div>
        </form>
    </div>
</div>

{% endif %}