0

I've got a blog listing template where pagination is not working as expected. I see the pagination links but when I follow one I get taken to a blank page.

My template routes are:

enter image description here

All links from listing template to single template work except for pagination links. I've also tried turning the blog/index tempalte to require segments but that also did not work

My blog listing template is:

            {exp:channel:entries channel="blog" limit="2" dynamic="yes"}
                <article class="post">
                    <div class="media">
                      <a class="pull-right" href="#">
                        {exp:ce_img:single src="{blog_image}" width="290" height="113" add_dims="no" attributes="class='media-object'"}
                      </a>
                      <div class="media-body">
                        <h4 class="media-heading"><a href="{route="blog/single" blog-post="{url_title}"}">{title}</a></h4>

                        {if blog_copy:has_excerpt}
                            <p>{blog_copy:excerpt text_only="yes"}&hellip;</p>
                        {if:else}
                            {exp:eehive_hacksaw
                                words = "25" 
                                append = "&hellip;"
                                allow="<p><b><a>"}
                                {blog_copy}
                            {/exp:eehive_hacksaw}
                        {/if} 

                        <a href="{route="blog/single" blog-post="{url_title}"}" class="readMore">Read More</a>
                      </div>
                    </div>
                </article>


                {paginate}
                <div class="row">
                    <div class="col-sm-12">
                    {pagination_links}
                        <ul class="pagination">
                            {!--
                            {first_page}
                                <li><a href="{pagination_url}" class="page-first">First Page</a></li>
                            {/first_page}
                            --}

                            {previous_page}
                                <li><a href="{pagination_url}" class="page-previous"><span class="glyphicon glyphicon-chevron-left"></span></a></li>
                            {/previous_page}

                            {page}
                                <li><a href="{pagination_url}" class="page-{pagination_page_number} {if current_page}active{/if}">{pagination_page_number}</a></li>
                            {/page}

                            {next_page}
                                <li><a href="{pagination_url}" class="page-next"><span class="glyphicon glyphicon-chevron-right"></span></a></li>
                            {/next_page}

                            {!--
                            {last_page}
                                <li><a href="{pagination_url}" class="page-last">Last Page</a></li>
                            {/last_page}
                            --}
                        </ul>
                    {/pagination_links}
                    </div>
                </div>
                {/paginate}



            {/exp:channel:entries}

1 Answer 1

0

Looks like I'm an idiot - forgot to put /blog/ in the template route for blog/index so it should be /blog/{pagination}

Why do I always find the solution minutes after posting? Why?

1
  • This has given me hope for how to go from page 1 (1st template entry list) to page 2 (2nd template entry list onwards) using different templates. Thanks for thinking aloud :)
    – Boshy
    Jan 25, 2015 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.