Support

Home Forums Event Espresso Premium How to make class display differently on the calendar?

How to make class display differently on the calendar?

Posted: January 9, 2014 at 12:17 pm


tamara smith

January 9, 2014 at 12:17 pm

I have classes that are running once a week for a month. On the calendar the class displays as ongoing every day of the week until that last day. Is there a way to make the class just show on the 1 day when it is happening? For example – I’d like the monday classes to display on the calendar ONLY on Mondays for the month.

Here’s a link to what it looks like currently:
http://www.growingtimeclasses.com/class-calendar/?event_category_id=gymnastics


Josh

  • Support Staff

January 9, 2014 at 4:15 pm

Hi Tamara,

What you can do is set the class start and end date for the first monday. Then duplicate that event (or use the Recurring events manager) to make more Monday classes for each time the class meets. The subsequent classes can be set to use the first monday’s event for registration. Here is a diagram that shows how to set this up using the recurring event manager:

Then:

Then:


tamara smith

January 9, 2014 at 5:40 pm

thanks. I’ll give that a shot.


tamara smith

January 9, 2014 at 5:55 pm

Josh- wait – how would registrations work then? If I can only accept a certain number of kids/class. Would the repeated classes take into account how many spots are remaining in the class?

-Tamara


Tony

  • Support Staff

January 10, 2014 at 2:29 am

Hi Tamara,

The method Josh has given you basically adds extra events that all point back to the first event. ALL registrations for those events go through the first event, so any event restrictions setup on that event will apply.

For example, say we setup ‘Gymnastics 101’ for 4 weeks.
Using the method above that is 4 events (one for each.. lets say Monday)

Setting up weeks 2-4 to use week 1’s registration url means when you click on events week 2, 3 or 4 you actually go to week 1 to register.

This allows you to have 1 attendee list to manage, so because we point to week 1, if that event has a max registration limit of 10, then only 10 attendees TOTAL can register on weeks 1-4 (because they all actually register to week 1) make sense?

When using the ‘Alt. Registrion URL’ feature you can think of the ‘extra’ events as pointers to whichever URL (event) you place in that field.


tamara smith

January 10, 2014 at 7:44 am

Perfect. Thank you Tony.


tamara smith

January 10, 2014 at 8:02 am

okay- trying my hand at the instructions above. The red box with the option to make this apply to the whole series… where does that come into play? It’s not popping up, do I need to select something to see that box?

next question – The second part of the instructions. (after “then”)- Is that when making the second event as part of the series? Or when would I do that?

Sorry for all the questions!
-Tamara


Tony

  • Support Staff

January 10, 2014 at 8:13 am

For the first question, it appears you do not have the Recurring Events Manager Add-on installed. It is this that gives the options within the red box.

Refer to your other thread for instructions on installing http://eventespresso.com/topic/problem-with-reoccurring-events/#post-73446

next question – The second part of the instructions. (after β€œthen”)- Is that when making the second event as part of the series? Or when would I do that?

When you create the events you’ll create the recurring series. Afterwards you can edit either just the single event you are working on, all events in the series, or future events from (& including) the current event your are editing.

So the first picture is from event 1, setting all the events in the series to use event ones registration url, the second picture is from event 1 once more, removing the registration url (event 1 already uses its own registration url), setting the event to display the registration form and updating just that single event (the red box).

It may not make sense currently, but once you’ve spent some time to see how the Recurring Events Manager (REM) works, you’ll understand more πŸ™‚


tamara smith

January 10, 2014 at 11:27 am

Ok. So now on my registration page I have 100s of events, even though they are all for the same event. Can I make it so only the first event displays on the registration page?


Josh

  • Support Staff

January 10, 2014 at 6:43 pm

Hi Tamara,

You mean the event list page, right? Are you directing people to view the list of events and the calendar too?


tamara smith

January 11, 2014 at 7:38 am

Josh,

What i was hoping for was a list registration page. But to also have a calendar maybe on my homepage that showed classes available as well. Both would allow a participant to click on the class name and register.


Josh

  • Support Staff

January 13, 2014 at 10:57 am

Hi Tamara,

You can make make the event list page only display the first event from a series with a bit of template hacking (this does require modifying a few PHP files).

First, you’ll need a function to define your first event in a series. Here’s something you can add to your custom file add-on’s custom_functions.php file or in a custom snippet plugin

// function to help display only the first event in a recurring event series
function get_recurrence_info( $recurrence_id = FALSE )
{
    $recurrence_info = '';
    if ( $recurrence_id )
    {
        global $wpdb;
        $r = $wpdb->get_results('SELECT * FROM ' . EVENT_ESPRESSO_RECURRENCE_TABLE . ' WHERE recurrence_id="'.$recurrence_id.'"');
        if ($wpdb->num_rows > 0)
                $recurrence_info = $r[0];
    }
    return $recurrence_info;
}

then you can open your wp-content\uploads\espresso\templates\event_list.php file, and locate the event_espresso_get_event_details function (around line 29 in my file) and just after the line 275 where it says:

foreach ($events as $event) {

You add:

$r = get_recurrence_info( $event->recurrence_id );
if ( $event->recurrence_id == 0 || $r->recurrence_start_date == $event->start_date ) {

and then add the closing curly brace at the end of the function

}

This will allow all non-recurring events to be displayed as well as the first event from a series of recurring events.


tamara smith

January 13, 2014 at 1:52 pm

Hmm. Thanks. This is a bit more advanced than I can handle at this time. Looks like I will leave the calendar off the website.

Thank you for your time.
-Tamara


Josh

  • Support Staff

January 13, 2014 at 2:08 pm

Hi Tamara,

The code I posted was for the event list, not the calendar.

The support post ‘How to make class display differently on the calendar?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Josh 5 years, 10 months ago ago

Topic Tags

Notifications

This topic is: resolved
Do NOT follow this link or you will be banned from the site!