From 9c38d294023836de94f4f9949dc8db9038dd262e Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 18 May 2018 10:15:04 -0400 Subject: [PATCH] Improve support for fields that can be placed in custom header of CommentList class --- wire/modules/Fieldtype/FieldtypeComments/CommentList.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wire/modules/Fieldtype/FieldtypeComments/CommentList.php b/wire/modules/Fieldtype/FieldtypeComments/CommentList.php index 2548a0f3..e8abbb43 100644 --- a/wire/modules/Fieldtype/FieldtypeComments/CommentList.php +++ b/wire/modules/Fieldtype/FieldtypeComments/CommentList.php @@ -180,6 +180,14 @@ class CommentList extends Wire implements CommentListInterface { $header = str_replace(array('{cite}', '{created}'), array($cite, $created), $this->options['commentHeader']); if(strpos($header, '{votes}') !== false) $header = str_replace('{votes}', $this->renderVotes($comment), $header); if(strpos($header, '{stars}') !== false) $header = str_replace('{stars}', $this->renderStars($comment), $header); + if(strpos($header, '{url}') !== false) { + $header = str_replace('{url}', $comment->getPage()->url() . '#Comment' . $comment->id, $header); + } + if(strpos($header, '{page.') !== false) { + $page = $comment->getPage(); + $header = str_replace('{page.', '{', $header); + $header = $page->getMarkup($header); + } } $liClass = '';