Compile iCal / Google Calendar events from Category, Month/Day or Venue views

Home Forums Calendar Products Events Calendar PRO Compile iCal / Google Calendar events from Category, Month/Day or Venue views

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #30224
    Will
    Participant

    Hello,
    I need to create an iCal / Google calendar export that compiles a limited set of event data. For example, if I’m looking at a Category page, I want to be able to click a button that gives me an .ics of all the events listed in that Category. Or all the events hosted by a venue on a single venue page, etc.

    Any way to do that?

    #30225
    Will
    Participant

    Sorry, I’m an idiot, I see that the Category page does that already. I’ll keep looking and see how it works, as I need to basically mimic this function for a custom wp_query I put on another page (listing all the events by tribe_organizer, basically).

    #30226
    Will
    Participant

    Shoot… I am not finding the source of this code. Dangit. I do need help on this. I’ve set up a couple custom pages where I’m using a custom wp_query to create a list of events filtered by a specific tribe_organizer (using my own fields), or a list of events that I’ve further categorized using a couple of custom post_types, again using Advanced Custom Fields. For example, http://pastebin.com/7VJ4cfxV is a custom query I put on a page to list out all events by a specific tribe_organizer, in a single-tribe_organizer.php template page.

    How would I go about using the tribe_get_ical_link() to dump just the contents of that wp_query?

    #30275
    Jonah
    Participant

    Hey Will,

    First, in almost all cases you’re always going to want to use WP_Query for custom queries. Here is an example of what you could use with your query args: https://gist.github.com/4447338

    With that code you should be able to simply plop tribe_get_ical_link() in the query loop and have it return what you need. Does that help?

    – Jonah

    #30484
    Will
    Participant

    Hey Jonah, unfortunately doing that still seems to have the entire calendar get pushed into the .ics. I posted my custom query here (just realized I left the if statement in checking for if tribe single ical link is true, I actually removed that in my code)
    http://snippi.com/s/5m3bz6r

    Then the while loop runs the tribe_get_ical_link(), but it generates the full calendar’s .ics.

    What I need it to do is take the single event, and merge it together with the any other events that are returned, and then set that up as the .ics, so it’s a compressed, limited set of calendar events that can be downloaded and added to the calendar.

    #30511
    Jonah
    Participant

    Hey Will,

    One thing you may want to look at is you should be using tribe_get_single_ical_link() for single events. tribe_get_ical_link() returns the link for the calendar.

    Does that help?

    – Jonah

    #30524
    Will
    Participant

    for a while I did set up a loop to create a single ical link for each of the events gathered in by that wp_query, but that wound up with this huge long ugly list of single events to subscribe to. Client not thrilled.

    No, what I’m looking to do is to simulate the functionality that creates the .ics on the tribe Category pages, or Venue pages. If you open a Category page, it will show a list of events related to that category. If you click on the iCal button, it will download an .ics that contains only those events.

    I just can’t figure out how to simulate that custom generation of events into a single ics file.

    #30537
    Jonah
    Participant

    Hey Will,

    I guess I don’t fully understand. So, the category .ics file is giving you what you need but you’re still trying to get it working right for other pages (Venues?)…

    – Jonah

    #30538
    Will
    Participant

    I created a custom page template for a custom collection of events revolving around exhibitions at different museums. The page is built with its own wp_query that is drawing in specific events that are related to those museums out of the Calendar. I need to create a .ics that is generated out of that collection of events.

    The Venue pages and the Category pages generate .ics files that compile the specific events that are related to the venue or the category page that you are viewing.

    I need to duplicate that functionality and create a .ics out of the events that are compiled on the custom page template I’ve built, using my custom wp_query.

    I need to create a .ics of th

    #30539
    Will
    Participant

    I wish I could show an example, but the site is private until the initiative goes live this year, so I can’t send out a link to it. 🙁

    #30540
    Jonah
    Participant

    Gotcha, well if you look at line 422 in /wp-content/plugins/events-calendar-pro/events-calendar-pro.php you’ll find the function used to create the feed. Maybe that will help.

    – Jonah

    #31332
    Andy Fragen
    Moderator

    Will, try putting this code in your ecp-page-template.php file. If you’re on a calendar view showing only one category then it should add a Google Calendar subscription with only that category. ECP doesn’t create an ics file for anything other than events, so you’d have to write your own code for venues.

    https://gist.github.com/4591089

    Andy

    #31334
    Will
    Participant

    Thanks Andy, wish that would work for me. Unfortunately, the category page already has working functionality. As I mentioned above, I was citing that the functionality that already exists on the category pages was the functionality I was trying to replicate in creating my own custom query of events, and creating a list of events that appears in a similar manner to the already existing category listings.

    I recommended to my client that we nix that customization, so it’s a moot point now.

    But thanks for the input!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Compile iCal / Google Calendar events from Category, Month/Day or Venue views’ is closed to new replies.