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.

Calendar: Any way to limit entries to first entry per day?

October 10, 2012 2:22pm

Subscribe [1]
  • #1 / Oct 10, 2012 2:22pm

    Susan

    81 posts

    I’m working on an event calendar.

    1 day of each month has two events. All other events are 1/day.

    Is there any way in the calendar to display only the first entry of a day in which there are multiple entries?

    (This isn’t a matter of if entries link to the entries for that day. I need to do an embedded template to grab the entry category and pass that to style for the TD for that day)

    If I loop the entries outside of the TD tags (see example below), EE will duplicate the cells for that day, resulting in 8 days a week.

    {if entries}
          {entries}
              <td class='{switch} {embed="embeds/code/goes/here"}'>
                    <a href="http://{day_path=channel/index}">{day_number}</a>
                    <div>
                        <a href="http://{title_permalink=channel/index}">{title}</a>
                    </div>
                </td>
          {/entries}
     {/if}


    I’d rather get just the first entry for that day and ignore subsequent entries for that day.

  • #2 / Oct 12, 2012 1:55pm

    Kevin Smith

    4784 posts

    Hi Susan,

    It appears the {entries} variable pair does not have the ability to limit the number of entries returned. That would certainly make for a good Feature Request if you’d like to add it.

    I do wish I had a better solution for you here!

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

ExpressionEngine News!

#eecms, #events, #releases