Home › Forums › Calendar Products › Events Calendar PRO › Compile iCal / Google Calendar events from Category, Month/Day or Venue views
- This topic has 12 replies, 3 voices, and was last updated 13 years, 2 months ago by
Will.
-
AuthorPosts
-
January 2, 2013 at 7:10 pm #30224
Will
ParticipantHello,
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?
January 2, 2013 at 7:12 pm #30225Will
ParticipantSorry, 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).
January 2, 2013 at 7:28 pm #30226Will
ParticipantShoot… 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?
January 3, 2013 at 1:15 pm #30275Jonah
ParticipantHey 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
January 9, 2013 at 12:45 am #30484Will
ParticipantHey 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/5m3bz6rThen 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.
January 9, 2013 at 12:00 pm #30511Jonah
ParticipantHey 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
January 9, 2013 at 1:59 pm #30524Will
Participantfor 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.
January 9, 2013 at 5:04 pm #30537Jonah
ParticipantHey 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
January 9, 2013 at 5:10 pm #30538Will
ParticipantI 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
January 9, 2013 at 5:11 pm #30539Will
ParticipantI 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. 🙁
January 9, 2013 at 5:14 pm #30540Jonah
ParticipantGotcha, 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
January 21, 2013 at 5:41 pm #31332Andy Fragen
ModeratorWill, 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
January 21, 2013 at 8:58 pm #31334Will
ParticipantThanks 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!
-
AuthorPosts
- The topic ‘Compile iCal / Google Calendar events from Category, Month/Day or Venue views’ is closed to new replies.
