Venue not importing
WordPress Event Management, Calendars & Registration › Forums › iCal Extension › Venue not importing
This topic contains 23 replies, has 6 voices, and was last updated by David Demastus 1 year, 1 month ago.
-
AuthorPosts
-
August 5, 2014 at 6:55 pm #11945
When I syncrhonize my iCal, the venues import and place all the information in the name, example Gaines Park Community Center, 1501 N Australian Ave, West Palm Beach, FL, United States. It is not parsing it to the appropriate fields, Address, City, State/Province, Country.
Here is what I get
Shouldn’t a proper sync put the Address, City, State, Zip, and Country into the correct fields so I don’t have to go back and do this individually. Please let me know, thanks
Jamie GantAugust 5, 2014 at 8:37 pm #11949Hi Jamie,
The iCal specification doesn’t provide for venue details aside from venue name and lat/lng co-ordinates. I’m currently looking into supporting venue details for feeds which come from an Event Organiser site, but for general iCal feeds that data is either not there or not provided in a standard format.
Venue details will unfortunately need to be entered initially.
Stephen HarrisNovember 2, 2014 at 8:52 pm #13336Hey there, Any updates on this? iCal finds the address for me here:
And yet this is what appears in the event;
Not terribly helpful given that there will be no lifeguard on duty.
- This reply was modified 10 years, 1 month ago by James Veitch.
James VeitchNovember 2, 2014 at 10:47 pm #13342Hi James,
I’m afraid I can’t see any of those images. I get “Access denied” when I try to view access the url. Could you allow public access or otherwise explain the problem in more detail?
Stephen HarrisNovember 2, 2014 at 11:08 pm #13343Hey there.
it’s just a droplr link
http://d.pr/i/1dGYN/4IUmS6Yl
http://d.pr/i/psVy/19FLduk2James VeitchNovember 3, 2014 at 10:39 am #13352Seems like the latitude-longitude co-ordinates haven’t been imported in this case. Can you give a link to the feed you’re using?
Stephen HarrisNovember 3, 2014 at 10:45 am #13353Hey there. sure it’s
webcal://p01-calendarws.icloud.com/ca/subscribe/1/_MX1_fp7oSi8ZHHTFdn9y6QP_7HtB2Wtch3Uv5n9IXwBBPkCru9jpw8tlqQWkP37fbvbKQOZFgR2JyyLqUsq3OvZfvGiv7_XRY42y6SJO_E/
James VeitchNovember 3, 2014 at 10:57 am #13354Thanks James,
Unfortunately the feed doesn’t include the co-ordinates of the venue. (More accurately it does, but it includes it under an “
X-TITLE
” property, which is not part of the iCal specification. There is a GEO property – but the feed doesn’t make use of this.There are hooks in place that are triggered when an iCal feed is imported that potentially you could use to re-scan the feed to obtain this value – but this would amount to rescanning the feed twice. However in the next update I’ll introduce a filter for when an “unknown property” is
encountered (eg. X-TITLE) which would allow you to include the data it contains if required.In the mean time, if the venues in the feed will be a small managable number, you can manually enter the details. You would only need to do this once for each venue.
Stephen HarrisJune 30, 2015 at 12:40 am #17621Hi,
I’m running into the same issue where all the address imported from two different feeds is put into the title of the venue so there are no address, lat or lon being imported. Is there any progress on this issue? I will be importing from many different calendars (usually Google calendars) and it is not feasible to manually update each venue.
Here is an example feed: https://www.google.com/calendar/ical/2v113sqaad63bp65qs6j98gc4k%40group.calendar.google.com/public/basic.icsAlso, is the importer smart enough to re-use a venue, if the event has a similarly named venue with same address (or very close to the same address)?
LynneJune 30, 2015 at 5:19 pm #17633Hi Lynne,
Sadly the iCal specifications do not stipulate any structure for venue data, so the LOCATION attribute can provide any details relating to the venue in any/no format. As such its not possible to isolate the venue name and address components.
If, hower, your feed(s) do follow a specific pattern for venue details it can be possible to do this. I’ll be imn touch later via email as I may have a short snippet which might help you.
Stephen HarrisJuly 2, 2015 at 2:15 am #17672This is the snippet I referred to above:
add_filter( 'eventorganiser_pre_ical_property_location', 'eoical_location_fix', 10,5 ); function eoical_location_fix( $skip, $value, $modifiers, $parser, $property ) { if ( ! empty( $value ) ) { $parts = explode( ',', $value ); $venue_name = array_shift( $parts ); $venue_name = trim( $value ); if( ! isset( $parser->venues[$venue_name] ) ) { $parser->venues[$venue_name] = $venue_name; } $parser->current_event['event-venue'] = $venue_name; } return true; }
Please see this post on where to put this code. While it doesn’t import the address details it does ‘correct’ the venue name assuming that the venue name/address (as it appears in the iCal feed) is a comma-seperated list with the venue name first. E.g.
<venue-name>, <venue-address>
.While that’s the most common format, I must stress that is by no-means mandated by the iCal specifications, so a feed may present the data very differently.
Latitude/Longtitude are imported so long as they are provided in the iCal feed.
Stephen HarrisJuly 15, 2015 at 10:44 pm #17906Thanks Stephen,
This was very helpful, especially since I’m new to word press. With your suggestion, my custom filter method to parses the location data into its subsequent address, city, postcode, etc parts but I found in order to have the fields saved, I had to modify the eo_fetch_feed function in ical-functions.php to save the additional meta data fields, similar to the existing code which is saving the latitude and longitude meta data for the venue.
Here is the code I added to eo_fetch_feed function:
foreach ($ical->venue_meta[$venue] as $key => $value) {
$args[$key] = $value ;<br />
}Let me know if there a better place to extend/modify the code.
Thanks,
LynneLynneJuly 25, 2015 at 1:17 pm #18078There’ll be a filter in the next (minor) version of iCal (e.g. 2.1.0):
add_filter( 'eventorganiser_ical_import_venue', 'my_ical_set_venue_details', 10, 4 ); function my_ical_set_venue_details( $venue, $event, $event_id, $ical ) { //Assuming venue is giving in iCal in the following form: // <name>,<address>,<city>,<state> $parts = explode( ',', $venue['name'] ); $keys = array( 'name', 'address', 'city', 'state' ); $count = min( count( $keys ), count( $parts ) ); $venue_details = array_combine( array_slice($keys, 0, $count), array_slice($parts, 0, $count) ); $venue = array_merge( $venue, $venue_details ); return $venue; }
In the above
$venue
is an array which will contain the keyname
(with the name as given in iCal), and possiblylatitude
andlongtitude
if these are given by the feed. It’s this array which is used to create the venue.$event
is the event parsed from iCal feed to which this venue is assigned.$event_id
is the ID of that event. Lastly$ical
is the parser object for context reference.Note: This will not update an existing venue.
As mentioned above this will only work from Event Organiser iCal 2.1.0+ which at the time of writing has not yet been released.
- This reply was modified 8 years, 3 months ago by Stephen Harris. Reason: Fixed errors in $keys declaration
Stephen HarrisJuly 27, 2015 at 5:50 pm #18102Sounds great! Thank you!
LynneSeptember 6, 2016 at 4:35 am #24067Hi Stephen, I’m jumping in on this thread pretty late, but I just tried the script you posted above (in reply #18078) and I just can’t get it to work. The venue name gets pulled in fine, but none of the other values (address, city, postcode).
I used the script exactly, and example from the iCal file I’m importing is:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//210.5.50.11//NONSGML kigkonsult.se iCalcreator 2.10//
CALSCALE:GREGORIAN
METHOD:PUBLISH
X-WR-CALNAME:McAdams
X-WR-CALDESC:Provider In Temporary Traffic Management Training
BEGIN:VTIMEZONE
TZID:Pacific/Auckland
X-LIC-VENUE:Pacific/Auckland
END:VTIMEZONE
BEGIN:VEVENT
DTSTART;TZID=Pacific/Auckland:20160920T110000
DTEND;TZID=Pacific/Auckland:20160920T160000
DTSTAMP:20160906T000456
CREATED:20150729T232409
LAST-MODIFIED:20160906T172800@mcadams.nz
UID:03850006@210.5.50.11
SUMMARY:Level 2/3 STMS NP Refresher (Tauranga)
DESCRIPTION:This new qualification is similar to the Level 1 Traffic Controller. The workshop provides an introduction to CoPTTM and qualifies the attendee to:\n\n - Carry out inspections on Level 1 roads\n - Carry out inspections on Level 2 & 3 roads (only in the area of induction with local specific conditions)\n\nThis workshop is suited to persons carrying out inspection activities and require occasional access Level 2/3 roads. The workshop includes an induction to the local road network.\n\nWorkshop Fee: $295.00.\n
<hr>
\nOther information:\nAssessments are sat at the workshop and a pass is required to achieve the TC_I warrant. Assessments are open book and a copy of the CoPTTM Handbook (Section J) is provided.\n\nWorkshop fees include the NZTA registration fee, a copy of the Level 1 Handbook (Section J) along with course handout material, assessments and catering. A certificate is provided on completion of the workshop which can be used as proof of qualification (until the NZTA card arrives). Fees are exclusive of GST.
URL:http://mcadams.nz
LOCATION:Downer Training Room, 58 Taurikura Drive, Tauranga, 3171
GEO:-37.742167;176.0995049
CATEGORIES:L2/3 STMS NP Refresher
END:VEVENT
END:VCALENDAR
Sorry for the novel. I’m not sure if there’s anything else in the iCal file that is stopping the Locations value from being parsed. I’ve tried excluding the GEO and X-APPLE lines and also tried removing spaces but I’m a bit stuck now.
Any help would be much appreciated.
Cheers
JamieJamie McCormack -
AuthorPosts