Answers.Body: <p>I've ended up using the Event ICS extension: <a href="https://lab.civicrm.org/extensions/eventics" rel="nofollow noreferrer">https://lab.civicrm.org/extensions/eventics</a> – which in its most recent form provides the ability to override the event location by entering whatever you want into the location field provided by the extension on a per-event basis. This lets me keep Zoom URLs off public-facing event information pages whilst still giving useful information to the people registering for the event.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-17T08:29:59.640Z
Answers.LastActivityDate: 2023-04-17T08:29:59.640Z
Answers.UserDisplayName: Graham
Answers.Body: <p>This is an old thread, but we had the same need for passing custom fields for CiviCRM events into a 3rd party calendar app, and figuring it out took a bit of sweat equity so hopefully this will help someone in the future.</p>
  <p>You can add the following (or similar) to the <strong>/CRM/Core/Calendar/ICal.tpl</strong> file (ideally save it off into your template folder so it doesn't get overriden with CiviCRM upgrade):</p>
  <pre><code>{assign var=&quot;shortuid&quot; value=$event.uid|substr:16}
  {assign var=&quot;position&quot; value=&quot;$shortuid|strpos:'_'}
  {assign var=&quot;evid&quot; value=$shortuid|truncate:$position:&quot;&quot;}
  X-MYCUSTOMFIELD:{crmAPI var='evt_info' entity='Event' action='get' return=&quot;custom_45&quot; id=$evid}{foreach from=$evt_info.values item=evt}{foreach from=$evt.custom_45 item=ch name=chapter}
  {if $smarty.foreach.chapter.first}{$ch}{else},{$ch}{/if}
  {/foreach}{/foreach}
  </code></pre>
  <p>It's not super elegant, but I couldn't, for the life of me, figure out how to get the event ID ($event.id or $event_id or $eventid didn't work) so had to extract it from the $event.uid variable.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-04-13T00:22:21.757Z
Answers.LastActivityDate: 2023-04-13T00:22:21.757Z
Answers.UserDisplayName: MtnPavlas
Body: <p>One of the organisations I work with runs perhaps 70 events or more over the course of a year. Many of these are invitation only, so while we use Civi to handle these events most of them are set as active, but not public, so they don't appear in our main iCal feed, which we use to promote public-facing events.</p>
  <p>I'm looking at using the <a href="https://civicrm.org/extensions/orgcivicoopeventprivateical" rel="nofollow noreferrer">Private iCal extension</a> which gives me the ability to publish feed URLs for events that are not public and filtered by type, which is great. But what I ideally want to do is include in the iCal entry the content of a customer field that I've created for Events.</p>
  <p>Any idea how I might go about this?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-10T10:38:29.647Z
Comments.Text: What kind of custom data? iCal feeds really just want a small amount of information and then link to the actual event.
Comments.UserDisplayName: Jenni Simonis
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-02-10T13:41:08.313Z
Comments.Text: I agree that brevity is key. I want to include a Zoom URL that isn't published on the event information page, but is in the iCal feed.
Comments.UserDisplayName: Graham
Tags: <civievent>
Title: How can I include custom field data in an iCal feed?
ThreadText: # How can I include custom field data in an iCal feed?
  
  (Asked by: username_0 on 2022-02-09)
  
  One of the organisations I work with runs perhaps 70 events or more over the course of a year. Many of these are invitation only, so while we use Civi to handle these events most of them are set as active, but not public, so they don't appear in our main iCal feed, which we use to promote public-facing events.
  
  I'm looking at using the [Private iCal extension](https://civicrm.org/extensions/orgcivicoopeventprivateical) which gives me the ability to publish feed URLs for events that are not public and filtered by type, which is great. But what I ideally want to do is include in the iCal entry the content of a customer field that I've created for Events.
  
  Any idea how I might go about this?
  
  **Tags:** civievent
  
  > **Comments:**
  > **username_1**: What kind of custom data? iCal feeds really just want a small amount of information and then link to the actual event.  
  > **username_0**: I agree that brevity is key. I want to include a Zoom URL that isn't published on the event information page, but is in the iCal feed.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2023-04-17. Score: 1 | Accepted answer
  
  I've ended up using the Event ICS extension: <https://lab.civicrm.org/extensions/eventics> – which in its most recent form provides the ability to override the event location by entering whatever you want into the location field provided by the extension on a per-event basis. This lets me keep Zoom URLs off public-facing event information pages whilst still giving useful information to the people registering for the event.
  
  
  ---
  
  ### Answer by username_2 on 2023-04-13. Score: 2
  
  This is an old thread, but we had the same need for passing custom fields for CiviCRM events into a 3rd party calendar app, and figuring it out took a bit of sweat equity so hopefully this will help someone in the future.
  You can add the following (or similar) to the /CRM/Core/Calendar/ICal.tpl file (ideally save it off into your template folder so it doesn't get overriden with CiviCRM upgrade):
  {assign var="shortuid" value=$event.uid|substr:16}
  {assign var="position" value="$shortuid|strpos:'_'}
  {assign var="evid" value=$shortuid|truncate:$position:""}
  X-MYCUSTOMFIELD:{crmAPI var='evt_info' entity='Event' action='get' return="custom_45" id=$evid}{foreach from=$evt_info.values item=evt}{foreach from=$evt.custom_45 item=ch name=chapter}
  {if $smarty.foreach.chapter.first}{$ch}{else},{$ch}{/if}
  {/foreach}{/foreach}
  
  It's not super elegant, but I couldn't, for the life of me, figure out how to get the event ID ($event.id or $event_id or $eventid didn't work) so had to extract it from the $event.uid variable.
  
  
  ---
  
  