Hi Elisa
Yes here is what we did:
1- we first have some ICS layout file (ics.php file in the layouts folder)
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
DTSTART;TZID=:
DTEND;TZID=:
RRULE:FREQ=
SUMMARY:
LOCATION:
DESCRIPTION:
END:VEVENT
END:VCALENDAR
2- at the record time fo the event we launch an aftersotre code:
// No Direct Access
defined( '_JEXEC' ) or die;
jimport( 'joomla.filesystem.file' );
$app=JFactory::getApplication();
$isNew=$config['isNew'];
$event=JCckContent::getInstance( $config['id'] );
$ics_file='images/event/ics/' . $config['pk'] . '/' . $event->get( 'alias' ) . '.ics';
$ics_layout=new JLayoutFile( 'ics' );
$ics_content=$ics_layout->render( $fields );
JFile::write( JPATH_ROOT . '/' . $ics_file, $ics_content );
$event->save(
'more',
array(
'ics_file'=>$ics_file
)
);
3- in the content view we have a before display code:
$id=$fields['art_id']->value;
$title=$fields['art_alias']->value;
$url=JURI::root();
$domain=substr($url,7);
$label=JText::_(iCal) ;
$ical="<a href='webcal://".$domain."images/event/ics/".$id."/".$title.".ics"." ' >$label</a>";
$fields['ev_event_lien_ics']->html=$ical;
$fields['ev_event_lien_ics']->value=$ical;