<p>The <code>paginate</code> tag isn't really designed to be used in this way. Instead you might want to look into creating a <a href="http://buildwithcraft.com/docs/routing#dynamic-routes" rel="nofollow noreferrer">custom route</a> using 'year','month','day' segment tags. These segment tags will be available as variables in your template, which you can use to grab the corresponding entries for that week (by calculating the start and end date of the week and grabbing entries with a postDate between these dates).</p>

<p>You can then create 'next' and 'previous' links to link to a day at the start of the previous/next week by adding or subtracting 7 days.</p>

<p>This answer shows an example using this <a href="https://craftcms.stackexchange.com/a/5456/784">technique for paginating by day</a>. That should get you most of the way there. Leave a comment if you still need help, and I can try and mock something up.</p>

<p><strong>Update</strong> 
Another option is to create a <a href="http://buildwithcraft.com/docs/routing#accessing-subpatterns-in-your-templates" rel="nofollow noreferrer">custom route</a> using 'subpatterns' defined in your config file for 'events/year/week':</p>

<pre><code>'events/(?P&lt;year&gt;\d{4})/(?P&lt;week&gt;\d{2})' =&gt; 'events/_weekindex',
</code></pre>

<p>This will make the variables <code>{{year}}</code> and <code>{{week}}</code> available to your template, which you can use to grab the entries.</p>

<p>You can convert weekNo to date using <code>{{ date.setISODate(year, weekNo) }} and date to week using</code>{{ now|date('Y/W') }}`.</p>

CC BY-SA 3.0
2015-04-30T02:40:27.857Z
2015-04-30T05:06:22.783Z
2017-04-13T12:51:00.303Z
Douglas McDonald
<p>I am trying to group entries based on week and then paginate them the same way. I'm not quite sure how to go about setting each page to be a separate week/group though. Thoughts?</p>

<datetime><pagination><group>
Paginate by Group
# Paginate by Group

(Asked by: username_0 on 2015-04-30)

I am trying to group entries based on week and then paginate them the same way. I'm not quite sure how to go about setting each page to be a separate week/group though. Thoughts?

**Tags:** datetime, pagination, group

---

## 1 answers

### Answer by username_1 on 2015-04-30. Score: 1 | Accepted answer

The paginate tag isn't really designed to be used in this way. Instead you might want to look into creating a custom route using 'year','month','day' segment tags. These segment tags will be available as variables in your template, which you can use to grab the corresponding entries for that week (by calculating the start and end date of the week and grabbing entries with a postDate between these dates).
You can then create 'next' and 'previous' links to link to a day at the start of the previous/next week by adding or subtracting 7 days.
This answer shows an example using this technique for paginating by day. That should get you most of the way there. Leave a comment if you still need help, and I can try and mock something up.
Update 
Another option is to create a custom route using 'subpatterns' defined in your config file for 'events/year/week':
'events/(?P\d{4})/(?P\d{2})' => 'events/_weekindex',

This will make the variables {{year}} and {{week}} available to your template, which you can use to grab the entries.
You can convert weekNo to date using {{ date.setISODate(year, weekNo) }} and date to week using{{ now|date('Y/W') }}`.


---

