I'm having trouble using the Pixel and Tonic's Events plugin. I actually have no clue where to start on how to get it to render events in a template. I'm currently trying to pass in:

{% for event in craft.events.events_calendars('calendarName') %}

Which is obviously wrong. Could anyone explain how I understand what methods and variables those methods take for custom Element types?

  • Important to note (as mentioned in Paul's answer), the P&T Events plugin is strictly an example plugin. It was built as a demonstration of how to create custom Element Types... the plugin was never intended to be used as-is.
    – Lindsey D
    Oct 6 '14 at 19:47
  • But if you need events... michaelrog.com/craftcalendars Oct 7 '14 at 1:20

The events plugin by Pixel & Tonic is an example of how to use custom Elements if you're building your own plugin. I don't think it should be used in a production environment (but please correct me if I'm wrong).

If you want to use it, you should take a look at the only variable for this plugin. This variable gives you the ability to get all events, filtered by your criteria. There's no way to get all calendars, only events:

{% for event in craft.events.events %}

{% endfor %}

One other plugin you could have a look at, is this one, still in private beta.

  • Awesome Paul! Thanks for the answer. I'm not seeing where the second (or first) craft.events.events is coming from there. Am I just missing something? Oct 6 '14 at 13:47
  • The first events is the plugin handle, the second is the events variable that provides a way to interact with the plugin's events from a template.
    – Paul
    Oct 6 '14 at 14:46
  • When I get some more rep, I'll come back and up vote these. Thanks so much for the help! Oct 6 '14 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.