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.

Displaying a week of entries from the calendar

July 30, 2007 11:16am

Subscribe [4]
  • #1 / Jul 30, 2007 11:16am

    Capt'n Morgan

    20 posts

    I’ve been working on a calendar using the built in functionality for making a calendar, along with the reepeat plug-in.  I have a few obstacles to get past yet, and here’s the latest;

    I want to display the current week of events.  I found the code to display a day, a month, and year at a time, but can’t quite get it for a week.

    There’s two different ways that I’ve tried.  First, I took the code I was using to display a single day’s events, and was hoping to tweak it to show the week.  When I looked at the syntax that can be used with calendar, I found that I should be able to add something along the lines of

    display_by="week"

    , as I did below, but that doesn’t seem to work.

    {exp:repeet:parse date_header_interval="day"}
    {repeet:no_results}
          <h3>Sorry, no results.</h1>{/repeet:no_results}
    {repeet:date_header}What's happening on %F %j, %Y:
    {/repeet:date_header}
    {exp:repeet:get_ids weblog="calendar" parse="inward"}
    {exp:weblog:entries weblog="calendar" entry_id="{repeet:entry_ids}" display_by="week" show_expired="yes" show_future_entries="yes" dynamic="off"}
    {repeet:item}
    {repeet:entry_id}{entry_id}{/repeet:entry_id}
    {repeet:entry_date}{entry_date format="%Y-%m-%d %H:%i"}{/repeet:entry_date}
    {repeet:expiration_date}{expiration_date format="%Y-%m-%d %H:%i"}{/repeet:expiration_date}
    {repeet:interval}{repeat_interval}{/repeet:interval}
    {repeet:include_dates}{include_dates}{/repeet:include_dates}
    {repeet:exclude_dates}{exclude_dates}{/repeet:exclude_dates}
    {repeet:display}    
    
    {title}
    {details}
    
          
    {repeet:start_time format="%m-%d-%Y"} - {repeet:end_time format="%m-%d-%Y"}
    
          {/repeet:display} {/repeet:item} {/exp:weblog:entries} {/exp:repeet:get_ids}
        {/exp:repeet:parse}

    Giving up on that one, I tried the simple route and grabed this code;

    <h2 class="sidetitle">Upcoming Events</h2> 
    <ul> {exp:weblog:entries weblog="calendar" show_future_entries="yes" show_expired="no" orderby="date" sort="asc" dynamic="on" limit="5"} 
    <li><a href="http://{title_permalink=calendar/details">{title}</a> ({entry_date format='%M %j'})</li> 
    {/exp:weblog:entries} 
    </ul>

    And that worked okay, except that it looks at expiration date and if an entry doesn’t have a an expiration date in place, it will display it, even if it’s past.

    I really just want to show the current week’s entries(Mon-Sun).  I likely won’t have any events that span days or weeks… if I do, they’ll be listed twice because of reepeat.

  • #2 / Jul 30, 2007 4:11pm

    tripp

    92 posts

    Not sure if this will help but I have a weekly events calendar based on this weblog entries code:

    {exp:weblog:entries weblog="{mainWeblog}" orderby="date" sort="asc" display_by="week" show_current_week="yes" start_day="Monday" show_future_entries="yes"}
  • #3 / Aug 03, 2007 12:20pm

    Capt'n Morgan

    20 posts

    That is helpful, but it still shows past event dates on repeating events that don’t have an expiration date until later in the month.

    It seems the challenge is that “show_expired=no” ins’t entirely helpful on recurring events.  How can I indicate that I want it to show the next x number of events from today on, for example?

  • #4 / Aug 07, 2007 12:23am

    Capt'n Morgan

    20 posts

    I was able to resolve this, thanks.
    I was not using the code from reepeat, like I needed to.

  • #5 / Sep 02, 2007 12:08am

    Phil J Leitch

    92 posts

    Capt’n,

    I am trying to use Repeet and the Calendar code to display one day of events at at time and be able to go back and forward. Seems like you landed on something similar.

    Care to post how you solved your problem as I think it will help with mine.

    The Repeet code is just so un-EE like that I can’t wrap my head around it like I probably should be able to.

    thnx.

  • #6 / Sep 03, 2007 12:32pm

    Capt'n Morgan

    20 posts

    Phil, this is the code I used to accomplish what I needed to;

    {exp:repeet:parse date_header_interval="day"}
          {repeet:date_header}<strong>%D, %F %d, %Y</strong>{/repeet:date_header}
          {repeet:no_results}No events are scheduled at this time.{/repeet:date_header}
          
          {exp:repeet:get_ids weblog="calendar" parse="inward" end="6 days"}
      
            {exp:weblog:entries weblog="calendar" entry_id="{repeet:entry_ids}" dynamic="off" show_expired="no" show_future_entries="yes"}
            {repeet:item}
              {repeet:entry_date}{entry_date format="%Y-%m-%d %H:%i"}{/repeet:entry_date}
              {repeet:expiration_date}{expiration_date format="%Y-%m-%d %H:%i"}{/repeet:expiration_date}
              {repeet:interval}{repeat_interval}{/repeet:interval}
              {repeet:include_dates}{include_dates}{/repeet:include_dates}
              {repeet:exclude_dates}{exclude_dates}{/repeet:exclude_dates}
              {repeet:display}
              
    
           <strong>{event_type} - </strong> <a href="http://{title_permalink=calendar/event}" target="_parent" rel="noopener">{title}</a>  {details}
    
              
       {/repeet:display}
            {/repeet:item}
            {/exp:weblog:entries}
    
          {/exp:repeet:get_ids}
    
    {/exp:repeet:parse}

    That displays 6 days of upcoming events, seperated by day.
    Hope that helps…

  • #7 / Jan 27, 2008 9:58pm

    Phil J Leitch

    92 posts

    Thanks!

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

ExpressionEngine News!

#eecms, #events, #releases