Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
I have been following the different types of Pagination tutorials to try and get my blog list to display pagination with the number of pages of posts with no luck. I am not sure where I am going wrong. Nothing seems to display with this code:

Code: Select all
 <!-- Main Content -->
        <div id="main">
            <!-- Normal Post -->
            <cms:pages masterpage='blog.php' folder=k_folder_name paginate='1' limit='3' >
            <div class="post clearfix">
                <a href="<cms:show k_page_link />"><h2><cms:show k_page_title /></a></h2>
                <ul class="post-meta">
                    <li class="author">By <a href="/about.php">Sharpen Your Axe</a></li>
                    <li class="date"><cms:date k_page_date format='M, jS y'/></li>
                    <li class="tags"><a href="<cms:show k_page_folderlink />"><cms:show k_page_foldertitle /></a></li>
                    <!--<li class="comments"><a href=""><cms:show k_comments_count /></a></li>-->
                </ul>
                <div class="post-entry">
                    <a href="<cms:show k_page_link />" title=""><img src="<cms:show blog_image />" alt="" class="image" /></a>
                    <p>
                        <cms:excerptHTML count='100' ignore='img'><cms:show blog_content /></cms:excerptHTML><a href="<cms:show k_page_link />">Read more...</a>
                    </p>
                </div>
            </div>
                     
            <!-- /Normal Post -->

                   
            <!-- Pagination -->
            <cms:nested_pages masterpage='blog.php' extended_info='1' paginate='1' limit='3' >
      <cms:if k_paginated_bottom >
            <ul class="pagination">
               <li class="prev"><a href="<cms:show k_paginate_link_prev />">Newer</a></li>
               <li><a href="<cms:show k_nestedpage_link />"><cms:show k_nestedpage_title /></a></li>
                <li class="next"><a href="<cms:show k_paginate_link_next />">Older</a></li>
            </ul>
            </cms:if>
            <cms:paginator />
            </cms:nested_pages>
            </cms:pages>
            <!-- /Pagination -->
      
        </div>
I'm really not understanding where the 'nested_pages' tag came from... It is not needed. You will need to style the new markup generated by the 'paginator' tag accordingly.
http://www.couchcms.com/docs/tags-reference/paginator.html
Code: Select all
<!-- Main Content -->
        <div id="main">
            <cms:pages masterpage='blog.php' folder=k_folder_name paginate='1' limit='3' >
            <!-- Normal Post -->
            <div class="post clearfix">
                <a href="<cms:show k_page_link />"><h2><cms:show k_page_title /></h2></a>
                <ul class="post-meta">
                    <li class="author">By <a href="<cms:link 'about.php' />">Sharpen Your Axe</a></li>
                    <li class="date"><cms:date k_page_date format='M, jS y'/></li>
                    <li class="tags"><a href="<cms:show k_page_folderlink />"><cms:show k_page_foldertitle /></a></li>
                    <!--<li class="comments"><a href=""><cms:show k_comments_count /></a></li>-->
                </ul>
                <div class="post-entry">
                    <a href="<cms:show k_page_link />" title=""><img src="<cms:show blog_image />" alt="" class="image" /></a>
                    <cms:excerptHTML count='100' ignore='img'><cms:show blog_content /></cms:excerptHTML><a href="<cms:show k_page_link />">Read more...</a>
                </div>
            </div>
            <!-- /Normal Post -->

            <cms:paginator />
            </cms:pages>
        </div>
That did the trick. So all I needed to do was add <cms:paginator /> and get rid of everything else?
Correct, that's all I did to fix it. The 'paginator' tag will display whatever is appropriate in each situation. It takes care of all the logic for you.

I did make some other changes to the code however, not sure if you noticed. I changed "/about.php" to "<cms:link 'about.php' />" and removed an extraneous paragraph tag.

Were you not able to figure out the comment count?
4 posts Page 1 of 1