We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45370
    • 2 Posts
    I'm wondering what is the best way in modx to dynamically create .ics files from all my event resources?

    I would basically like a button on my event pages that says "Add to Calendar"

    My resources have a startDate and endDate tvs.

    Resources have urls like events/name-of-event

    I would like it if someone visits events/name-of-event.ics it would dynamically create the ics file download.

    Is something like this possible with modx?

    This question has been answered by gissirob. See the first response.

    • discuss.answer
      • 44580
      • 189 Posts
      I expect there are a number of ways to do this. You could write a snippet that fires on the button submit - there are many examples of how to do this in the forums. In terms of what code to put in the snippet, a quick google of 'create ics from php' should give you all the code samples you need.

      Or maybe it's as simple as this: https://modx.com/extras/package/icalx

      Hope this helps.
        • 45370
        • 2 Posts
        https://modx.com/extras/package/icalx looks like the way to go. Thanks @gissirob