We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum
Collection Items over multiple functions
I have a scenario where I need to output Collection items over two functions within my home page. I don't want to repeat items over the two templates. The first template displays the first 7 items, the second template displays the next 6 items and should be used for pagination.
<If first page>
Display first 7 items in promoted style
Display next 6 items in normal style (with pagination)
<?php perch_collection('Blog', [ 'template' =>'blog/_blog_list_big.html', 'sort' =>'date', 'sort-order' =>'DESC', 'count' => 7, ]); ?>
<?php perch_collection('Blog', [ 'template' =>'blog/_blog_list.html', 'sort' =>'date', 'sort-order' =>'DESC', 'count' => 6, 'paginate' =>'true', 'pagination-var' => 'post-page', ]); ?>
Some of the challenges
- How do I detect if I'm on the first page
- I know I can't use 'start' => 8 and 'pagination' => 'true' at the same time on the second template so can't begin the second function's items at item 8 with pagination
Any help advice would be appreciated.
Want to reply to this thread?Login with Perch