ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Paginate Year Archive

February 17, 2010 3:08am

Subscribe [5]
  • #1 / Feb 17, 2010 3:08am

    BC Team

    244 posts

    My URL structure is: http://mysite.com/news/archive/2009/ where news is a template group and archive is template.

    My entries tag is:

    {exp:weblog:entries weblog="news" dynamic="off" year="{segment_3}" disable="categories|category_fields|member_data|trackbacks" limit="5"}

    How do I paginate these, just the links “older entries” and “newer entries”?

    {paginate}
    {if previous_page}<a href="http://{auto_path}">Newer Entries</a>{/if}
    {if next_page}<a href="http://{auto_path}">Older Entries</a>{/if}
    {/paginate}

    If I click older entries at the moment I will get a url like this:
    http://mysite.com/news/archive/2009/P5/

    and then this:
    http://mysite.com/news/archive/2009/P5/P5/

  • #2 / Feb 17, 2010 3:31am

    John Henry Donovan

    12339 posts

    BC Team,

    If I click older entries at the moment I will get a url like this:
    http://mysite.com/news/archive/2009/P5/

    That looks correct. Is it limiting it to 5?
    The segment P5 isn’t sequential 1,2,3 etc but related to your entry limit when paginating

    and then this:
    http://mysite.com/news/archive/2009/P5/P5/

    This I believe is because you are removing index.php via a htaccess. You will need to update your htaccess to take pagination into account.

    You can test this by disabling your htaccess and adding index.php back into your URL structure

  • #3 / Feb 17, 2010 4:18am

    silenz

    1651 posts

    Since you are using dynamic=“off” you need to specify the paginate=”” parameter as well.

  • #4 / Feb 17, 2010 8:12am

    Sue Crocker

    26054 posts

    Thanks for the assist, silenz.

    BC Team, do John and silenz’s instructions help?

  • #5 / Feb 17, 2010 6:11pm

    BC Team

    244 posts

    Thanks, my htaccess was ok:

    RewriteCond $1 ^(template_groups|P[0-9]{2,8}) [NC]

    it was because I was missing the paginate=“bottom” when using dynamic=“off”

    Thanks for the support

  • #6 / Feb 17, 2010 7:24pm

    Adam Dorsey

    1439 posts

    Glad your up and running.

    Please feel free to post again 😊

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases