0

EE v2.7.2. Calendar v1.8.5.

I have a calendar using the SolSpace Calendar add-on, with some recurring events. On the individual event pages for these recurring events, the date shows up as the first occurrence of the event and not each individual date, I think because it's only creating one instance of the event page and not targeting the date in the url.

Example: Prime Rib Dinner Nights are Tuesdays at 5:30 PM. The first occurrence on our calendar is January 7th, and all instances of the event on the calendar show that date instead of the actual date.

Clicking on Prime Rib Dinner Night from the July Tuesdays should show the July dates instead of Jan 7th.

Calendar for July: http://sdyc.org/calendar/month/2014/07/ Prime Rib Dinner Night event page: http://sdyc.org/calendar/events/2199/ Not sure how to code that to work properly on the calendar/events template. Thank you.

{exp:calendar:events orderby="title" sort="asc" event_id="{segment_3}" date_range_start="2010-01-01" show_months="144"}
   {if no_results}No Results{/if}
   <div class="event_details">

{exp:channel:entries channel="calendar_events" disable="trackbacks|member_data|pagination" limit="1"}                                         
<img class="event_photo" src="{event_image}" alt="" align="right"/>{/exp:channel:entries} 

      <h1>{event_title}</h1>

    <p><strong>DATE & TIME:</strong><br/>
  {if event_all_day} 
    {event_start_date format="%l, %F %j, %Y"}{if event_multi_day} - <br/>
    {event_end_date format="%l, %F %j, %Y"} {/if}

  {if:else}
    {event_start_date format="%l, %F %j, %Y"}{if event_multi_day} - {event_end_date format="%l, %F %j, %Y"}{/if}<br/>
     {event_start_date format="%g:%i%a"} - {event_end_date format="%g:%i%a"}
  {/if}
    </p>


      <p><strong>LOCATION:</strong><br/> {event_location}</p>
      {if event_speaker != ""}<p><strong>SPEAKER:</strong><br/> {event_speaker}</p>{/if}
      <p><strong>EVENT DETAILS:</strong><br/> {event_summary}</p><br/>

   </div>
{/exp:calendar:events}
1
  • 1
    FYI: I edited your question to format your code.
    – Anna_MediaGirl
    Jul 30, 2014 at 22:51

1 Answer 1

0

What we normally suggest people do is build date segments in the link to the detail page (from the calendar month view), and then use the Calendar:Date tag to parse those segments from the URI into your template. Here's what I mean:

For your link in the Calendar month view, check if the event recurs, and then append the date for that occurrence to the link:

<a href="
    {path='calendar/events'}/{event_url_title}/
    {if event_recurs}
        {event_start_date format="%Y/%m/%d"}/
    {/if}
">{event_title}</a>

In your event detail page, grab the date segments from the URI and parse them into your page with the Calendar:Date template tag:

<p>
{if event_recurs}
    {exp:calendar:date
        base_date="{segment_4}-{segment_5}-{segment_6}"
        output_date="today"
    }
        {date format="%l, %F %j"} @ {event_start_date format="%g:%i%a"}
    {/exp:calendar:date}
{if:else}
    {event_start_date format="%l, %F %j @ %g:%i%a"}
{/if}
</p>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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