Multiple Day Event Formatting

Home Forums Calendar Products Events Calendar PRO Multiple Day Event Formatting

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1146271
    Emily Pryor
    Participant

    Is there any way to make the formatting for a multiple day event be “greyed” back when it’s not the first day?

    I’ve been able to do it via a jQuery each function but that only works when there’s just one event a day, with mulitple events a day some recurring multiple days, the loop gets too complex.

    Ideally it would be something like setting the link color to be different when it’s not the first day of a multiple day event.

    Thanks!

    #1146385
    Brook
    Participant

    Howdy Emily,

    I would love to help you with this. Are you trying to do this on List View for events that span multiple days? Basically you just want a different CSS class attached to the event when it is a followup day?

    If we’re on the same page let me know and I’ll research the best way for what you specifically need. If  you need something a little different, I’ll look into that instead.

    Cheers!

    – Brook

    #1146477
    Emily Pryor
    Participant

    This would be in the calendar view for events across multiple days, URLs below.

    So yes, one class around the first instance (there’s a DIV/H3/A structure, it looks like it’d be in the outside DIV) and then a different class around all other instances would be perfect.

    What I was trying to do was simulate that with jQuery each loops around the same HREFd A tags, and that works fine when there’s just one event a day, but doesn’t work when there’s multiple on a day the way it’s looping. See them nicely here in August, but not in September. (Which you might have to reload to get the jQuery to kick in.)

    http://data2x.org/events

    http://data2x.org/events/2016-09/

    If you want to move this thread to just email, I’m actually Chad, the developer for Data2X and am at [email protected]. But it’d fine to keep things here as well if it needs to be.

    Thanks!!

    #1147197
    Brook
    Participant

    Thanks for clarifying Chad. This should be easy enough to do with a WP filter. I just wrote up something you can insert into your functions.php which will add CSS classes to the month view events:

    https://gist.github.com/elimn/310d67f65c2bebdfce2ca42146f6ebcb

    The class you would want to target would be ‘tribe-month-multiday-start-date’. Style that with CSS and you should be golden.

    Did that do you what you needed?

    Cheers!

    – Brook

    #1147214
    Emily Pryor
    Participant

    Thanks much, that should work perfectly, but this line has a PHP error:

    $cur_day = tribe_events_get_current_month_day()[ ‘date’ ];

    From your docs, looks like that returns an array, but that’s not the right syntax, at least it’s throwing an error on the []. So I tried this to pull the array then get the value:

    $cur_day_array = tribe_events_get_current_month_day();
    $cur_day = $cur_day_array[‘date’];

    And while that doesn’t throw an error, it’s not inserting the classes. I’m assuming this would be added to the DIV tag which surrounds the H3 and A, and I don’t see anything in there. Looking at the code, it all looks logical and correct to me, so not sure why it’s not working.

    Thanks for your continued assistance!!

    Chad

    #1147514
    Brook
    Participant

    Howdy Chad,

    Good call on that. It sounds like you’re on an older version of PHP so that  line needed to be changed.

    Have you disabled Month View Cache for now? If it’s enabled these changes won’t appear for a while. That setting can be found in WP-Admin > Events > Settings > Display . I forgot to mention needing to disable that. If that did not do the trick, do you have any other sorts of caches in place that might need to be cleared or disabled temporarily?

    Cheers!

    – Brook

    #1147518
    Emily Pryor
    Participant

    The cache wasn’t on, and nothing else that would affect anything in the functions.php file.

    I changed the function to be only:

    $classes[] = ‘testCHAD’;
    return $classes;

    Which should put that class in every entry regardless (at least from how I’m reading things) and it’s not doing that. It seems like the function is running (since the errors triggered), but not actually hooking in to the calendar.

    Thanks!

    Chad

    #1147967
    Brook
    Participant

    That is odd. I think I might have discovered why. It’s possible the priority of the hook is too soon.

    I just updated the above snippet, would you mind trying the latest version? It should fix both of the errors you’ve experienced. Does it?

    Cheers!

    – Brook

    #1148290
    Emily Pryor
    Participant

    HOORAY! Thanks so much, working perfectly!

    http://data2x.org/events

    Chad

    #1148864
    Brook
    Participant

    Perfect news! Thanks for getting back.

    Let us know if you ever need anything else.

    Cheers!

    – Brook

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Multiple Day Event Formatting’ is closed to new replies.