From 5fd4cd6ac521d3a24681511b8d4c798443da5db7 Mon Sep 17 00:00:00 2001 From: Flavio Copes Date: Wed, 7 Oct 2015 15:43:16 +0200 Subject: [PATCH] Store page name in the comments file --- comments.php | 1 + templates/partials/comments.html.twig | 1 + 2 files changed, 2 insertions(+) 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'