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 links are showing blank pages

July 25, 2014 10:35am

Subscribe [2]
  • #1 / Jul 25, 2014 10:35am

    ComicStix

    1 posts

    The pagination displays fine for the first page and there are links to the other pages on the bottom. But when I click on the next button or the page numbers it goes to a blank page. I looked through the archives and tried to fix the problem, but to no avail. On the pages that are displaying blank, only the content area is displaying a blank page. My embedded templates are still working (header and footer).

    <!DOCTYPE html>
    {embed="embeds/.main_header"}
    </head>
    <body>
    {embed="embeds/.main_mast"}
    
    
      {exp:channel:entries channel="shared_stories" paginate="bottom|top|center" limit="2" category="{last_segment}" dynamic="no" }
    
     <div class="unit-centered unit-60 text-centered">
       <div class="units-row">
            <b> {ss_first_name} {ss_last_name} | {categories show_group="2"}{category_name}{/categories} | {categories show_group="1"}{category_name}{/categories} </b>
            
            {exp:power_truncate limit="300" cut_words="y" suffix="..."}
            {ss_story} 
            {/exp:power_truncate}
            
            {categories show_group="3"}
            <a href="/main/display_full_entry/{category_id}/{entry_id}">Read More</a>
            {/categories}
       </div>
       
       {paginate}
         Page {next_page} of {total_pages} pages {pagination_links} 
       {/paginate}
       {/exp:channel:entries}
       
     </div>
     
    
    {embed="embeds/.main_footer"}
    {embed="embeds/.main_footer_scripts"}
    </body>
    </html>
  • #2 / Jul 28, 2014 12:03pm

    Giraffentoast

    152 posts

    paginate=“center”...? Where you got that from?

    Try paginate=“both”. Here’s the rest of the documentation:
    http://ellislab.com/expressionengine/user-guide/templates/pagination.html#paginate


    If pages beyond 1 don’t work, it could have to do with your routing.
    Because what happens? On /group/template/P2 you suddently get an additional segment_3 you didn’t have before. That could affect conditionals you’re running somewhere.

    Of course, you got a whole lot of weird category stuff in that loop I’m not going to debug now.
    My advice would be: get rid of everything between the opening and closing tags and just output the {title}.

    If that works, add the rest of your code step by step and see what breaks it.

  • #3 / Jul 28, 2014 12:05pm

    Giraffentoast

    152 posts

    I just realized you’re doing

    category="{last_segment}"

    So, I was probably right. The new segment you’re adding by going to page 2 or 3 will break your loop. Because there is no category called P2 or P4.

    You will have to do something like /group/template/category/P2 and/or look into paginate_base.

  • #4 / Jul 29, 2014 11:14am

    ComicStix

    1 posts

    My routing got messed up because like you said the last segment changed to P1,P2, etc. So I just changed it to {segment_3} and it works perfectly! Thanks!

  • #5 / Jul 29, 2014 11:27am

    Giraffentoast

    152 posts

    Awesome! Glad you got it to work.

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

ExpressionEngine News!

#eecms, #events, #releases