diff --git a/comments.php b/comments.php index 677b800..faae130 100644 --- a/comments.php +++ b/comments.php @@ -80,6 +80,7 @@ class CommentsPlugin extends Plugin ]; } else { $data = array( + 'name' => $post['name'], 'comments' => array([ 'text' => $post['text'], 'date' => gmdate('D, d M Y H:i:s', time()), diff --git a/templates/partials/comments.html.twig b/templates/partials/comments.html.twig index af337eb..9139d09 100644 --- a/templates/partials/comments.html.twig +++ b/templates/partials/comments.html.twig @@ -9,6 +9,7 @@ jQuery(document).on('click tap', '.js__add-new-comment', function(event) { text: $('.js__new-comment-text').val(), name: $('.js__new-comment-name').val(), email: $('.js__new-comment-email').val(), + name: "{{ grav.page.header.title }}" path: "{{ grav.uri.path }}" }, type: 'POST'