Evolition CMS comments
Yet another simple comments solution based on PageBuilder and FormLister
Package provides:
- Template Variable "comments" with buil-in configs for PageBuilder
- Chunk to display comments list (pb_commentslist)
- Simple comment form (pb_commentsform)
- Simple informer plugin on manager welcome page that indicates documents with new comments
- Download as zip archive and install via extras module from zip file
- Assign Template Variable "comments" to desired template
- Put the chunks {{pb_commentslist}} and {{pb_commentsform}} in the template source
- Change
&to=
parameter in ForLister call in {{pb_commentsform}} to your e-mail
Both can be installed via Extras module from admin panel without extra downloads.
By default all the comments posted to PageBuilder invisible. If you want to publish by default add &visible=`1`
in FormLister call in {{pb_commentsform}}
By default comments shown as in the admin panel. Thus, newer comments will be in the end of list. To reverse them (new on top) there is no option for PageBuilder call. But you can list comments reversed (or unstyled) using Blade
@php
$comments = $modx->runSnippet('PageBuilder', ['renderTo' => 'array','container'=>'comments'],0,'comments')[0];
$comments_rev = array_reverse($comments);
@endphp
@foreach ($comments_rev as $item)
<div class="comment">
{{ $item['name'] }}
{{ $item['comment'] }}
{{ $item['date'] }}
@if($item['answer'])
Admin reply: {{ $item['answer'] }}
@endif
</div>
@endforeach
Provide the &docId=`N`
parameter in FormLister call in {{pb_commentsform}} to post comments to particular page
Try to specify the timezone (or comment the line) in snippet pb_addcomment
By default, Date format for "Date Added" is specified in
If you are using other format in [(datetime_format)] system setting than dd-mm-YYYY
You should replace the line with
/* for mm/dd/YYYY */
'date'=> date('m/d/Y H:i:00'),
/* for YYYY/mm/dd */
'date'=> date('Y/m/d H:i:00'),