Continue displaying events until after they're over (or have been over a week)

Home Forums Calendar Products Events Calendar PRO Continue displaying events until after they're over (or have been over a week)

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #336472
    jonschr
    Participant

    This should be obvious, I think, and I was surprised I couldn’t immediately find other people with the same question.

    What I’d like to do is have all views continue showing events that are happening today, so that if a registrant needed directions the day of an event, they could just go on the site, and they’d see their event listed first. Ideally, I’d like to list events even up to a week after they happen (many of our events are recurring, and people could technically still sign up until week 2).

    Anyone have a link to a similar question or know where I could look? I’d prefer to use a hook to modify all archive queries rather than changing each individually, but whichever solution is available would be fine.

    (Oops; I don’t know how I accidentally posted this in two places, but I’ll try to delete the other one).

    #355836
    Barry
    Member

    That’s an interesting question and I suspect that it’s going to be the sort of customization that is sufficiently niche we will really have to leave the fine detail to you – but I’d be happy to explore this a little and offer some pointers if I can 🙂

    What I’d like to do is have all views continue showing events that are happening today … Ideally, I’d like to list events even up to a week after they happen (many of our events are recurring, and people could technically still sign up until week 2).

    Can you describe in more detail how you picture this working and if you really need it to happen on all views – are you hoping to apply this to week and month view for instance, or just list view?

    Might a separate page/widget that exists for this purpose suffice, leaving the existing views to operate as they currently do?

    #356014
    jonschr
    Participant

    All views would be fine with me (photo, list, month, week…) Just not single (the site still needs to correctly perceive what day it is.

    A separate page would be ok, but not ideal, because there’s really not a way that wouldn’t be confusing to users. The main events page simply showing events from up to a week ago no matter what view it’s on would be awesome.

    I’m not sure what other detail I could give, though. Is there a filter which I could use to modify the query to accomplish this?

    #365311
    Barry
    Member

    Hmm, well, I guess I’m just not clear on quite what you’re envisioning. For example, in month view: if today’s date was 1st August would you expect the calendar grid to start with the last week of July (28th July perhaps) and carry on to include the entire month of August?

    Or do you see this as a straightforward list that might appear before the calendar grid?

    Let’s say it’s the latter, since that’s fairly easy, you could obtain an array containing all events in a given timeframe with some code like this:

    // Get a list of events taking place within a specific
    // timeframe - you would need to add logic to calculate
    // the correct start/end dates
    $events = tribe_get_events( array(
    	'eventDisplay' => 'custom',
    	'start_date' => '2014-07-06',
    	'end_date' => '2014-12-12'
    ));
    
    // Then display them however makes sense for your use case
    foreach ( $events as $event ) echo $event->post_title; 

    Of course there is still quite a lot to flesh out there (perhaps you wouldn’t always want to display this list in month view, if for example we’re already half way through the month). To learn more about customizations in general I’d definitely also recommend scoping out our Themer’s Guide.

    I hope that helps – really though this is something that is definitely going to be a fairly bespoke customization and we’ll have to leave you to determine the details and final implementation 🙂

    #380279
    kinddesign
    Participant

    This is similar to what I am hoping to achieve in this thread:

    Still display events that have passed

    As the calendar is for a 10 day festival, if I can’t find a way to keep older events form still showing, the Festival ‘Lineup’ is just going to keep getting smaller and smaller as the Festival goes on! Like you, I’m also looking to find a loop that will keep showing all events, even if they are highlighted as ‘Finished’, until a point where I will stop showing the lineup.

    I’m personally only looking to really modify the List & Day View, as opposed to Month, but I expect the principles are the same.

    I’ll have a play with the loop suggestion above as well.

    Cheers!

    Mat

    #414543
    jonschr
    Participant

    I’d be happy, actually, if it simply modified the query to add to the date range on the first page only of each set of archives. Do you have a sample of someone hooking into the query in some way?

    If not, then I could probably simply add a list to each of the views using your code above as a starting point.

    #425621
    Barry
    Member

    We’d need to leave it to you to explore more involved options like modifying the query in this particular case – but if you search here on the forum and more widely for terms like pre_get_posts and parse_query you’ll probably be able to dig up some good stuff and indeed you may be interested to read through our own code, particularly within the TribeEventsQuery class which lives in:

    the-events-calendar/lib/tribe-event-query.class.php

    Beyond that, adding a supplementary list before the main view is probably a good way to go.

    I’ll go ahead and close out the thread at this point as I don’t think there’s too much more we can do to help with this one – though if any further specific questions do crop up certainly feel free to create new threads and if one of the team can point you in the right direction they’ll be happy to do so 🙂

    Good luck!

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Continue displaying events until after they're over (or have been over a week)’ is closed to new replies.