Plugin

Archived
Forum
(read-only)

Entries List

ExpressionEngine 1.x, ExpressionEngine 2

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

     

conditionally start from the top

Support Request

Jelle Dijkstra
Jelle Dijkstra

Hi!

I am displaying postings in a random order. I am using entries list for the previous/next navigation, which works like a dream. However, when i’m at the last (or first) item, i would like to show the first item, so by clicking on the previous/next links, my visitors can loop through all the entries. Ideally it would be something like the following (introducing some new vars here ;-))

{exp:entries_list category="{embed:thecat}" entry_id="{embed:theid}"channel="kaartjes" per_page="1"}
{if previous_entry_url_title}
<div class="prev">Previous <a href="{previous_entry_url_title}" title="Previous {previous_entry_title}">&lsquo;{previous_entry_title}&rsquo;</a></div>
{if:else}
<div class="prev">Previous <a href="{last_entry_url_title}" title="Previous: {last_entry_title}">&lsquo;{last_entry_title}&rsquo;</a></div>
{/if}
{if next_entry_url_title}
<div class="next">Volgend kaartje: <a href="{next_entry_url_title}" title="Volgend kaartje: {next_entry_title}">&lsquo;{next_entry_title}&rsquo;</a></div>
{if:else}
<div class="next">Next: <a href="{first_entry_url_title}" title="Next: {first_entry_title}">&lsquo;{first_entry_title}&rsquo;</a></div>
{/if}
{
/exp:entries_list} 

 

Laisvunas
# 1
Developer
Laisvunas

Hi,

That’s the good idea. In the next several days I will investigate how to add this feature.

Jelle Dijkstra
# 2
Jelle Dijkstra

That would be great! it’s the only little bump to clear before releasing a new site…

Jelle Dijkstra
# 3
Jelle Dijkstra

I fixed my issue, with a conditional and an embeed. but it would still be a good addition!

Laisvunas
# 4
Developer
Laisvunas

Hi,

I added the variables such as “previous_entry_url_title”, “previous_entry_title”, “last_entry_url_title”, “last_entry_title” in the version 4.2.

If you were a little bit more patient you would spare some coding :)