Help Desk

eventDisplay = Don't show past events? + add the date dropdowns?

  • Posts: 37 Topics: 3 Answers: 2
    | Permalink

    The problem Im having is that I effectively have 2 calendars on the same page, one is a hidden grid view calendar that appears on every page and is accessed through a javascript button in the header, the other is a Listview style listing on the “events” page in the nav.
    After a bit of faffing about I’ve worked out that I need to pretty much bypass the standard event page (as Im using the calendar in the header), so I’ve created a new Events page using the script on this page :
    https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events

    Under the First Get Event Example.

    This shows all events though, I need it to just show future events, also is there a tag or bit of script that I can put in to include the date dropdowns?

    Posts: 37 Topics: 3 Answers: 2
    | Permalink

    ok, worked out i can update the function by changing “all” to “upcoming”, which’ll show all the upcoming events.
    or … I can just use the /events/upcoming/ and link to that from the nav. I can’t get the month dropdowns to work though, is there a solution to do that?

    Posts: 37 Topics: 3 Answers: 2
    | Permalink

    another quick one.
    Im using the aforementioned script, is there a way to pass in the cateogry name in some way, I can get it using php tribe_meta_event_cats();
    but that brings in a link as well, I need to just get the name so that I can assign it as a class and style using a colour. Is that possible.

    I’ll hopefully get this online soon so you can have a better idea of what Im talking about, deadline is 8 hours away, so a bit flushed at the moment.

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    I can’t get the month dropdowns to work though, is there a solution to do that?

    Not sure I completely understand, but by default the upcoming events list does not include month dropdowns. It shows all upcoming events, in paginated form, from today until the end of time. Or at least until the date of the last event in the database.

    is there a way to pass in the cateogry name in some way, I can get it using php tribe_meta_event_cats()

    Yes, it works just like a regular WP query. So if you want to include a category you will probably need to include a taxonomy query.

    I need to just get the name so that I can assign it as a class and style using a colour. Is that possible.

    This plugin by Andy Fragen may not do quite what you want, but you could certainly look at how it’s been put together and it might give you a few ideas:

    http://wordpress.org/extend/plugins/the-events-calendar-category-colors/

    Posts: 37 Topics: 3 Answers: 2
    | Permalink

    Here’s my site (Work in Progress)
    http://bikeeventsdev.madebrave.com/

    On my Homepage Upcoming Events List, I have the wee coloured boxes which represent a category, this is pretty straight forward because the class on the LI’s are named for the container, ie li class=”cat_sportive”.
    I thought this would be easy to ull through to this page : http://bikeeventsdev.madebrave.com/events-listing-page/, which lists all the events.

    Posts: 37 Topics: 3 Answers: 2
    | Permalink

    I thought it’d be really simple and I was just missing osmething really obvious. I’ll dig about some more. cheers

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    Oh I see – so all you need is the category to be reflected in a CSS class for the list item containing the event?

    The thing is, if I look at a default upcoming events list the events are contained in divs, rather than list items, and there is indeed a CSS class for each container reflecting the category (if one has been assigned, of course).

    Perhaps you have customized the list view and have dropped the code that puts this in place?

    Posts: 37 Topics: 3 Answers: 2
    | Permalink

    Yup, just need the css class, it doesn’t really matter if it’s div’s or LI’s as I can just change, just need to get an individual class for each category (works on the homepage using the Advanced Widget), but, Im not actually using the list view on these pages, as I am already using the calendar from the “View Events” (slide down overlay) link in the header, and I can’t have 2 calls to the events calendar in the same page.
    So, im using the tribe_get_events() function to pull out the events on this page.

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    OK, got you now. Well, if you are unable to use the regular upcoming events list which already has this property (of representing the category as a CSS class) and customize from there you’ll need to ape what that default template does.

    I’d think if you use the post_class() function this should all be handled for you, so long as you either explicitly pass in the post (event) ID or call setup_postdata() first of all.

    Does that help here?

    Posts: 37 Topics: 3 Answers: 2
    | Permalink

    Thanks Barry.
    I couldn’t get that to work at all. I did a work-around where I just added a custom Field to each event which defines the event category, then pull this into the template using the tribe_custom_field() tag, Not the best … but works.

    Posts: 18146 Topics: 17 Answers: 973
    | Permalink

    So long as you’re sorted 🙂 and thanks for posting back with the approach you used, might be helpful for others.