Forum

Thread tagged as: Problem, Blog

perch_blog_post_comments() won't paginate comments

I'm modifying a Bootstrap template to be managed by the Perch Blog app and I can't get blog post comments to paginate.

I'm displaying them like this:

<?php 
  perch_blog_post_comments(perch_get('s'), array(
    'paginate' => true,
    'count' => 4,
  )); 
?>

This will display the comments and limit them to 4 but it won't display the pagination.

I'm also using my own comment.html template in perch/templates/blog/comment.html. Not sure if that's causing the problem.

Diagnostics:

Perch is up to date
PHP 7.0.10 is up to date
MySQL 5.6.28 is up to date
Image processing available
SUMMARY INFORMATION

Perch: 2.8.33, PHP: 7.0.10, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: 241ae00989d1995ffcbbf63d579943635faf9972 $, with PDO
Server OS: Darwin, apache2handler
Installed apps: content (2.8.33), assets (2.8.33), categories (2.8.33), perch_blog (5.0)
App runtimes: <?php $apps_list = array( 'content', 'categories', 'perch_blog', );
PERCH_LOGINPATH: /perch
PERCH_PATH: /Users/matthewsanchez/Dropbox/blog/perch
PERCH_CORE: /Users/matthewsanchez/Dropbox/blog/perch/core
PERCH_RESFILEPATH: /Users/matthewsanchez/Dropbox/blog/perch/resources
Image manipulation: GD
PHP limits: Max upload 32M, Max POST 32M, Memory: 128M, Total max file upload: 32M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: blog:8888
DOCUMENT_ROOT: /Users/matthewsanchez/Dropbox/blog
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php
Matt Sanchez

Matt Sanchez 0 points

  • 4 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Can we see your comment.html template?

comment.html:

<perch:before>
  <h3>Comments</h3>
    <div class="media">
  <hr>
</perch:before>
        <div id="comment<perch:blog id="commentID" type="hidden" />" class="media">
      <a class="pull-left avatar" href="#"><img class="media-object img-circle" src="//www.gravatar.com/avatar/<perch:blog id="commentEmail" type="email" label="Email" order="2" hash="md5" required="true" />?s=120&amp;d=mm" width="40" height="40" alt=""></a>
      <div class="media-body">
        <h4 class="media-heading"><a href=""><perch:blog id="commentName" type="text" label="Name" order="1" required="true" /></a><span><perch:blog id="commentDateTime" format="d M Y H:i A" type="date" time="true" label="Date" /></span></h4>
        <perch:blog id="commentHTML" encode="false" html="true" type="textarea" label="Message (HTML)" order="4" required="true" />
      </div><!-- media-body -->
    </div><!-- media -->
<perch:after>
    </div><!-- media -->
</perch:after>
Rachel Andrew

Rachel Andrew 394 points
Perch Support

I don't see any pagination markup in there. You need to add that in the perch:after tags if you want pagination.

Thanks Rachel! The pagination tags weren't in the default comment.html template so I didn't know I had to add them manually.