0

I am showing past events for visitors to reference old performances by using 'show_expired="yes"' however the page got very big so I used pagination to break it up. I also use {if expiration_date < current_date} content {/if}, so only past show are shown.

When I employ pagination, I get large blank spaces on the first page where the current content wants to show, but I don’t want it too show. How do I disable the pagination from wanting to try and show blank spaces where the current shows are trying to show.

{exp:channel:entries channel="now_playing"  show_expired="yes"  limit="3" paginate="bottom"}

{if expiration_date < current_time}
 content of paage includes description and photo of past shows
 {/if}

{paginate}
 <p>Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}  
2

Instead of using conditional check inside your channel entries loop, consider providing stop_before parameter to limit your entries to those created before certain date. Be aware though the parameter works with entry_date, not expiration_date.

https://ellislab.com/expressionengine/user-guide/add-ons/channel/channel_entries.html#stop-before

| improve this answer | |
  • {exp:channel:entries channel="now_playing" orderby="date" sort="desc" stop_before="<?php echo $current_time; ?>" dynamic="no" paginate="bottom" } – seeingis Jan 13 '15 at 23:11
  • {exp:channel:entries channel="now_playing" orderby="date" sort="desc" stop_before="<?php echo $current_time; ?>" dynamic="no" paginate="bottom" } does not work. – seeingis Jan 13 '15 at 23:13
  • Did you use example for the docs or anything else? Is your PHP parsing preference for template set to "On Input", as required? – Yuri Salimovskiy Feb 3 '15 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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