Hello,
We are using ical-plugin and wallflux.com-service to get our Facebook events to events organiser. Wallflux is proving URL-attribute for ical events. This URL gives link back to Facebook.
Could it be possible to have “More information” button below event organiser post (event-meta-event-single.php), which could redirect to URL given in ics-feed?
Example feed: http://www.wallflux.com/events/363719408882
Jari Laari
Hi Jari,
It’s certainly possible to add more information the standard event details. Simply copy event-meta-event-single.php
into your theme and edit there. As for getting this additional information from the feed, that’s not possible (currently).
However, in the next update will add the ability which other fields you want stored.
To do this, you’ll need to specify which attribute you want to store, and what meta key (custom field) to store it under. This is done by filtering the $meta_key_map
(see below:)
//iCal synx 1.4 only!
add_filter( 'eventorganiser_ical_sync_meta_key_map', 'jari_store_facebook_url' );
function jari_store_facebook_url( $meta_key_map ){
//$meta_key_map is an array indexed by iCal attributes for an event (lowercased)
//The value is the meta key
$meta_key_map['url'] = 'facebook_url';
return $meta_key_map;
}
Then in the template:
echo sprintf( '<a href="%s"> View on Facebook </a>', get_post_meta( get_the_ID(), 'facebook_url', true ) );
The url will be one of the default attributes stored, and will be stored up the meta key: _event_ical_url
. You can change that if you like (it’s not otherwise used by Event Organiser), or instead of doing all the above, just use:
echo sprintf( '<a href="%s"> View on Facebook </a>', get_post_meta( get_the_ID(), '_event_ical_url', true ) );
in your template. This data will only be present once the feed as been synced after updating.
Additionally there will be other hooks added:
eventorganiser_ical_sync_event_inserted
– passes event ID, event (iCal) array and feed ID, when an event is created from a feed.
-
eventorganiser_ical_sync_event_updated
– passes event ID, event (iCal) array and feed ID, when an existing event is updated from a feed.
which means there’s more than one way to crack this particular nut.
Stephen Harris
Did I understood correctly example you writed is only for saving static information (not from feed) to event? Where that first function should be saved?
Do you have any estimation when new update will be announced? In class-eo-ical-parser.php there seems to be already some implementation for handling URL-attribute from ical-feed 😉
Jari Laari
Probably end of next week.
Yes, the url is collected from the feed, but it’s not stored. So the data is effectively lost. In the next update the url will be stored as event meta data. Additionally the above code allows you to save other data collected from the feed to the event’s meta data (the example I gave is of the url, but that will be stored anyway…)
The function jari_store_facebook_url()
(if required) should be in a utility plug-in or functions.php
. In your case, however, you would just need to add the following wherever you wanted to display the url:
echo sprintf( '<a href="%s"> View on Facebook </a>', get_post_meta( get_the_ID(), '_event_ical_url', true ) );
Stephen Harris
Thanks for the great support 🙂 I am looking forward to the update.
Jari Laari
Is saving event meta data from feed possible yet in latest version (2.8.2)?
Jari Laari
Hi Jari,
The change needs to be made in the iCal extension (1.4) – due to be released over this weekend. Apologies for the delay!
Stephen Harris
Just a note that Event Organiser iCal sync 1.4.0 has since been released.
Stephen Harris
Thanks. This works great =)
<?php echo sprintf( ‘View on Facebook ‘, get_post_meta( get_the_ID(), ‘_event_ical_url’, true ) ); ?>
Jari Laari