Forum

Thread tagged as: Question, Blog

Blog Turn Paging Off - Pagination / Paginate

Is there a way to set the paging true/false?

I tried the 'paginate' option from the normal perch_content_custom but did not work:

perch_blog_custom(array(
    'count' => 6,
    'template' => 'post_in_list.html',
    'sort' => 'postDateTime',
    'sort-order' => 'DESC',
    'paginate' => false,
));

I also tried 'paging' as see in post_in_list.html which didn't work either. Many thanks, Nick

Nicholas Nelson

Nicholas Nelson 0 points

  • 7 years ago

Interestingly, when I add another option like 'start' the pagination goes away:

perch_blog_custom(array(
    'count' => 6,
    'start' => 2,
    'template' => 'post_in_list.html',
    'sort' => 'postDateTime',
    'sort-order' => 'DESC',
));

I tired adding 'paginate' => true but the pagination did not show up.

Also I would like to use pagination with Section list and Category list...

perch_blog_custom(array(
    'filter' => 'sectionID',
    'match' => 'eq',
    'value' => $secID,
    'category' => $catSlug,
    'template' => 'post_in_list.html',
    'sort' => 'postDateTime',
    'sort-order' => 'DESC',
    'paginate' => true,
));

But just like the others ^ this doesn't work.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you added the markup to your template?

The default markup is still in post_in_list.html I change it slightly so that "previous" comes before the page numbers.

<perch:after>
    <perch:if exists="paging">
        <div class="paging">
            <perch:if exists="not_first_page">
                <a href="<perch:blog id="prev_url" encode="false" />">Previous</a>
            </perch:if>

            <perch:blog id="current_page" /> of <perch:blog id="number_of_pages" />

            <perch:if exists="not_last_page">
                <a href="<perch:blog id="next_url" encode="false" />">Next</a>
            </perch:if>
        </div>
    </perch:if>
</perch:after>
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, great. Which version of Blog are you running?

According to Settings > Diagnostics I have perch_blog (4.1). I also still have define('PERCH_PRODUCTION_MODE', PERCH_DEVELOPMENT); in my config file, if that happens to make a difference.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I'll see if I can reproduce it next week.