On the new website we’re developing, we’ve created what we’re calling series — a series of entries collected together under a common banner, like a newspaper column.
Series are a separate channel from stories. A series landing page is just supposed to display a list of teasers that link to the stories that fall within it.
Unfortunately, for some reason we can’t get pagination to work on the series landing pages. I was hoping someone here might have some suggestions for us.
Here’s the template for the series.
{html_head}
<title>
Post Series | RJI
</title>
{head_content}
{html_head_end}
{embed="main/_navbar"}
<ol class="breadcrumb">
<li><a href="http://{site_url}">Home</a></li>
<li><a href="http://{path=stories/index}">Stories</a></li>
<li class="active">Series</li>
</ol>
<div id="main-section" class="container">
<div class="row">
<div class="col-md-8 col-sm-12">
<div class="page-header">
<h2>Post Series</h2>
</div>
<div class="card-bg">
<ul id="recent-posts" class="media-list">
{exp:channel:entries channel="series" disable="categories|member_data|pagination"}
<li class="media card">
<a href="http://{post_path}class=pull-left">_ {!-- If there is a news image, use that, else maybe it's an event so if there is an event image use that, else there is no given image, use default image --}_ {if series_image}_ {series_image}_ {url:rect}_ {/series_image}_ {if:elseif series_banner}_ {series_banner}_ {url:rect}_ {/series_banner}_ {if:else}_ {site_url}/images/posts/rji-post.jpg_ {/if}_ </a>
<div class="media-body">
<h4 class="media-heading"><a href="http://{post_path}">{title}</a>
<span class="small capitalize">{entry_date format="%F %j, %Y"}</span></h4>
{exp:trunchtml chars="256" exact="yes" ending="..."}{series_description}{/exp:trunchtml}
</div>
</li>
{/exp:channel:entries}
</ul>
</div>
</div>
<div id="sidebar" class="col-md-4 hidden-sm hidden-xs">
{embed="main/_sidebar" recent="YES" events="YES" related="NO" topics="NO"}
</div>
</div>
</div>
{page_end}
{/if}Thanks.
L.
Whoops. I forgot the pagination code was in a separate snippet.
{!-- Using custom pagination so Bootstrap CSS can work (need classes .pagination .page-first .page-last) --}
{paginate}
{pagination_links}
<ul class="pager">
{previous_page}
<li class="previous"><a href="http://{pagination_url}#recent-posts">← Newer</a></li>
{/previous_page}
{next_page}
<li class="next"><a href="http://{pagination_url}#recent-posts">Older →</a></li>
{/next_page}
</ul>
{/pagination_links}
{/paginate}Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.