5

All,

I am trying to display the next n future entries for a channel. The query I'm using is posted below, but I've realized that since I limit the entries in the channel entries query, the if statement applies to the limited group of five entries. Rather than producing the next five entries.

Instead, I'm looking for a query that will:

  1. Pull the entries for a channel
  2. Determine whether or not the entry occurs in the future
  3. Display the next five upcoming entries.

I am working on someone else's site without FTP access to load a plugin, so I'm hoping to do this within the template.

My current code:

{exp:channel:entries 
  channel="blocks" 
  show_future_entries="yes" 
  dynamic="on" 
  orderby="entry_date" 
  sort="asc" 
  disable="pagination|member_data|trackbacks" 
  limit="5"}
     {if entry_date > current_time}
       <li>
         {entry_date format="%l at %g:%i %a"}: 
         {block-venue}
           {block-events show_future_entries="yes"}
             <a href="{path='events/{url_title}'}">{title}</a>
           {/block-films-events}
       </li>
     {/if}
     {if no_results}<li>See you next year!</li>{/if}
{/exp:channel:entries}

Thanks in advance for any help you can provide!

4

Would simple adding of start_on parameter help you?

 start_on="{current_time format='%Y-%m-%d %H:%i'}"
0

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.