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.

Pagination method 1 doesn't work when year and month are in the URL

August 16, 2010 10:20pm

Subscribe [2]
  • #1 / Aug 16, 2010 10:20pm

    applicode

    5 posts

    There appears to be a bug with pagination.  When using Method 1 from the user guide it does not create the correct page links when paginating channel entries if the year and month are in the url.


    For example the url http://www.mysite.com/newsletter/2010/08

    This will produce the following pagination when using Method 1:

    Page 1 of 2 pages < 1 2

    The first part of the pagination output is correct (Page 1 of 2 pages) but the second part is incorrect.  Even though you are on page 1, the pagination indicates you are on page 2 (no hyperlink).  The “<” and “1” are both hyperlinked to page 1.

    Pagination (Method 1) works perfectly when removing the Year/Month from the URL

    Method 1 from User Guide (does NOT work):

    {paginate}
    Page {current_page} of {total_pages} pages {pagination_links}
    {/paginate}

    I am using EE 2.1 Build 20100810

    Not sure if this is related to bug 13106 (Resolved).

    If using Method 2, the previous and next links work perfectly.

    Method 2 from User Guide (works):

    {paginate}
    
    {if previous_page}
    <a href="http://{auto_path}">Previous Page</a>  
    {/if}
    
    {if next_page}
    <a href="http://{auto_path}">Next Page</a>
    {/if}
    
    {/paginate}
  • #2 / Aug 17, 2010 9:29am

    applicode

    5 posts

    To easily reproduce this, install EE 2.1 with the Agile Records data.

    Create a template called newstest

    In the index of the newstest template, place the following code:

    {exp:channel:entries channel="news" orderby="date"  limit="1" paginate="top"}
            
                    {if no_results}No news{/if}
                    
                    <h2>{title}</h2>
    <p>                </p><h3>{entry_date format="%F %j %Y"}</h3><p>            </p>
    
    <p>                    {news_body}</p>
    
    <p>            {paginate}<br />
                Page {current_page} of {total_pages} pages {pagination_links}<br />
                {/paginate}</p>
    
    <p><br />
            {/exp:channel:entries}

    Go to http://www.yoursite.com/index.php/newstest

    You’ll see the pagination works correctly.

    Now add the year and month to filter the results

    Go to http://www.yoursite.com/index.php/newstest/2010/08 (assuming your news articles are dated in the month of august of 2010)

    You’ll see the pagination is incorrect and does not work correctly.

  • #3 / Aug 17, 2010 11:06pm

    Brandon Jones

    5500 posts

    applicode, I can reproduce and that does seem inconsistent. Go ahead and report in the Bug Tracker. Thanks.

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

ExpressionEngine News!

#eecms, #events, #releases