0

I have a site running Solspace Calendar and am having trouble displaying certain occurrences that have been edited by my client.

My 'event2' template displays properly for one-off events as well as recurring events where an occurrence has not been altered. But when my client edits a specific occurrence of a recurring event (like a promotional image or adding a different price, for example), the {exp:calendar:occurrences} tag does not return ANY information.

• Example of one-off event displaying correctly: http://clubomgsf.com/calendar/event2/cake/2015/01/16/

• Example of recurring event whose occurrence has not been edited after creating the recurring event: http://clubomgsf.com/calendar/event2/nsa1/2015/01/13/

• Example of a recurring event whose occurrence has been edited and thusly does not return any data: http://clubomgsf.com/calendar/event2/nsa5/2015/01/06

Is there a reason why creating an occurrence is breaking this loop? If so, what is the proper or alternate way to display each of these types of occurrences? I appreciate any insight that you guys can provide!

Excerpt from 'event2' template:

{exp:calendar:occurrences
            event_name="{segment_3}"
            date_range_start="{segment_4}-{segment_5}-{segment_6}"
            date_range_end="{segment_4}-{segment_5}-{segment_6}"
            show_days="1"
            }



            <div id="event-header" style="background-image:url('{event_image}')"></div>
                <img id="event-poster" src="{event_image}" />
            <div id="event-infobox">




                <!-- FACEBOOK SHARE DIALOGUE -->
                <a href="javascript:fbShare('{current_url}', '{title}', '', '{event_image}', 520, 350)">
                    <img class="f-icon" src="{site_url}website-images/static-information/facebook.png" />

                </a>

                <!-- TWITTER SHARE DIALOGUE -->
                <a href="javascript:twitterShare('https://twitter.com/share?', 520, 350)">
                    <img class="f-icon" src="{site_url}website-images/static-information/twitter.png" />
                </a>
                <br /><br />


                {if subheader}<div id="event-subheader">{subheader}</div>{/if}
                <span id="event-name">{title}</span>
                <br /><div style="margin-top:-6px"><small><br /></small></div>
                <span id="event-date">{exp:stash:get name="month" random} {segment_6}, {segment_4}</span>




                    <div id="event-price">
                        <span class="event-dolla">
                            {if price}${price}</span>
                        {if:else}Free{/if}
                        <span class="event-priceinfo">{price_info}</span><br />

                        {if ticket_options}
                        {ticket_options search:buy_status="=not inactive"}
                            <a href="{ticket_options:buy_link}"><button class="owhole" style="margin-top: 6px;">{ticket_options:buy_text}</button></a><br />
                        {/ticket_options}
                        {/if}

                        <div id="event-summary">{event_summary}</div>
                    </div>



            </div>
        {/exp:calendar:occurrences}
0

By default, occurrences do not have their own ID, but share the ID of the main event entry. When an occurrence is edited, they get their own ID. If you usually pass an event_id in your tag, this ID will be different for the edited occurrence. This is why the {event_parent_id} variable is available to pass the original event entry ID when necessary: http://www.solspace.com/docs/calendar/events/#event_parent_id

The better answer is to use {exp:calendar:cal} instead of {exp:calendar:occurrences}. This is particularly true since you're trying to display occurrences within a set timeframe (assumed from the date_range_start="" and date_range_end="" parameters in your code). {exp:calendar:cal} is the only tag that will calculate event occurrences within a set chronological timeframe. Details about how each tag works is explained in more detail here: http://www.solspace.com/docs/calendar/getting_started/ (Recommended read)

With {exp:calendar:cal}, your edited occurrence should also be included in your occurrence list.

| improve this answer | |
  • I have changed the tag to the {exp:calendar:cal} tag with parameters, but am still not getting any information to display for this occurrence. I'm not trying to build a "list" of occurrences. I'm simply trying to show one particular occurrence. I have tried event_name, event_id, event_range_start + "_"_end and show_days. Nothing inside of the tag outputs, even standard text, which suggests that the tag simply isn't pulling any data. I read and reread the getting_started document that you provided (even prior to posting my initial question), but it doesn't seem to answer my question. – Paredes Creative Jan 23 '15 at 19:50
  • Here is the tag that I'm using: {exp:calendar:cal event_name="{segment_3}" date_range_start="{segment_4}-{segment_5}-{segment_6}" date_range_end="{segment_4}-{segment_5}-{segment_6}" show_days="1" } NOTHING DISPLAYS HERE {/exp:calendar:cal} – Paredes Creative Jan 23 '15 at 19:51
  • Where is the {segment_3} coming from? I don't mean the URL, but what is generating the ID that shows up in segment_3? This solution page might also help, as it shows how you can "zoom in" on a specific occurrence: support.solspace.com/solution/categories/115922/folders/… The only difference is that when you have an edited occurrence, you get the original event entry_id from {event_parent_id} instead of {event_id}. Non-edited occurrences share {event_id} with the original event entry. – Solspace Jan 26 '15 at 2:28

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.