Plugin

Developer
Supported

Entries List

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Laisvunas

     

You must be logged in to post.

Can I use previous/next links in a multi-entry template?

General

artmem
artmem

I need to include previous/next links with every entry in a multi-entry template, which can’t be done with the regular EE previous/next tags, because I need them to be inside the channel entries tag.  Is this something that can be done with this plugin?

Laisvunas
# 1
Developer
Laisvunas

It can be done using Entries List plugin, if I understood you correctly.

Can you post some code to illustrate what should be achieved?

artmem
# 2
artmem

This is what I’m trying to do:

{embed="site/.header"}

{exp
:channel:entries channel="pages" orderby="sort-order" sort="asc" paginate="bottom" disable="categories|category_fields|member_data"}

<!-- Start Page -->
<
div data-role="page" id="p{entry_id}">
 
{page_content}
 
 
<ul class="ui-pagination" data-role="pagination">
 
{exp:channel:next_entry}
  
<li class="ui-pagination-next"><a href="#p{entry_id}">Next</a></li>
 
{/exp:channel:next_entry}
 {exp
:channel:prev_entry}
  
<li class="ui-pagination-prev"><a href="#p{entry_id">Prev</a></li>
 
{/exp:channel:prev_entry}
 
</ul>

</
div><!-- /page -->

{/exp:channel:entries}

{embed
="site/.footer"
Laisvunas
# 3
Developer
Laisvunas

Hi,

What you need is possible.

The code will be as this:

{exp:channel:entries channel="pages" orderby="sort-order" sort="asc" disable="categories|category_fields|member_data" parse="inward"}

<!-- Start Page -->
<
div data-role="page" id="p{entry_id}">
 
{page_content}
 
 
<ul class="ui-pagination" data-role="pagination">
{exp:entries_list entry_id="{entry_id}" channel="pages" orderby="sort-order" sort="asc"}
{if next_entry_id 
!= ""}<li class="ui-pagination-next"><a href="#p{next_entry_id}">Next</a></li>{/if}
{if previous_entry_id 
!= ""}<li class="ui-pagination-prev"><a href="#p{previous_entry_id}">Prev</a></li>{/if}
{
/exp:entries_list}
 
</ul>

</
div><!-- /page -->

{/exp:channel:entries}