ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Sort order truncating returned channel entries

May 04, 2011 6:15pm

Subscribe [2]
  • #1 / May 04, 2011 6:15pm

    dallasthiele

    6 posts

    I have a channel for upcoming events which displays in a few places on my site. One of the fields is the events date which I use to sort the list and display a little icon for the page. There’s a conditional that checks to see if the date is today through 60 days out. I’m using a little php to calculate the 60 days from today. This has been working for over 6 months with no issues.

    For some reason events are now getting cut off at June 15, 2011. Nothing I did (including removing the date filter and turning off php) fixed the problem. Randomly I changed the sort order from ascending to descending, and there were my missing events. Changing the sort order back to ascending again truncated at June 15, 2011.

    Here the beginning of my code if it helps:

    {exp:channel:entries channel="events" orderby="event_date_icon" sort="asc" dynamic="no"}
    {if event_date_icon >= current_time && event_date_icon <= <?php echo strtotime("60 days"); ?>}
    <div class="event">
        <div class='date'>
            <div class='month'>{event_date_icon format="%M"}</div>
            <div class='day'>{event_date_icon format="%d"}</div>
        </div>
        <div class="event_info">
    ...

    Any ideas of why this may be happening? Thanks!

  • #2 / May 05, 2011 10:09am

    Sue Crocker

    26054 posts

    Hi, dallasthiele.

    Might you have more than 100 items that fit your criteria? If you don’t specify differently, EE only shows the first 100 entries. Try adding something like limit=“150”

    Does that help?

  • #3 / May 05, 2011 10:17am

    dallasthiele

    6 posts

    That was it! I hadn’t deleted any of the outdated events yet so that makes perfect sense. Thank you!

  • #4 / May 05, 2011 11:07am

    Sue Crocker

    26054 posts

    Glad to hear that info helped. Feel free to start a new thread if you have any more questions.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases