1

How to call and print only Event Types (title and handle of event types) of Event Plugin -> https://verbb.io/craft-plugins/events/features

Moderator Added from Comments:

I need to filter the events based on event types, I am using radion buttons inside a form to select the event type and than pass that value to URL as param. than i am getting that value to filter the events, as follows : {% set selectedCategory = craft.app.request.getParam('category') ?? 'all' %} {% paginate craft.events.events.type(selectedCategory).limit(12) as pageInfo, pageEntries %}

I need to filter the events based on event types, I am selecting the event type and then pass that value to URL as param. then I am getting that value to filter the events, as follows :

{% set selectedCategory = craft.app.request.getParam('category') ?? 'all' %} {% paginate craft.events.events.type(selectedCategory).limit(12) as pageInfo, pageEntries %}

I have tried {% set eventTypes = craft.events.getAllTypes() %} Neither the property "getAllTypes" nor one of the methods "getAllTypes()", ....." exist and have public access in class "verbb\events\variables\EventsVariable".

5
  • Voting to close because the question lacks details. Please explain what you're trying to do, what you have tried so far, and in what way it's not working as expected.
    – MoritzLost
    Commented Dec 6, 2023 at 14:41
  • I need to filter the events based on event types, I am using radion buttons inside a form to select the event type and than pass that value to URL as param. than i am getting that value to filter the events, as follows : {% set selectedCategory = craft.app.request.getParam('category') ?? 'all' %} {% paginate craft.events.events.type(selectedCategory).limit(12) as pageInfo, pageEntries %}
    – user14621
    Commented Dec 6, 2023 at 14:54
  • I need to filter the events based on event types, I am selecting the event type and then pass that value to URL as param. then I am getting that value to filter the events, as follows : {% set selectedCategory = craft.app.request.getParam('category') ?? 'all' %} {% paginate craft.events.events.type(selectedCategory).limit(12) as pageInfo, pageEntries %} I have tried {% set eventTypes = craft.events.getAllTypes() %} Neither the property "getAllTypes" nor one of the methods "getAllTypes()", ....." exist and have public access in class "verbb\events\variables\EventsVariable".
    – user14621
    Commented Dec 6, 2023 at 15:22
  • Please edit your question and add that info, and include the code examples as code blocks. It's very hard to read in the comments.
    – MoritzLost
    Commented Dec 6, 2023 at 15:44
  • 1
    I've modified the question to include the asker's comments in the question body. Cheers, all!
    – cherrykoda
    Commented Dec 18, 2023 at 19:41

1 Answer 1

1

Check out the documentation on available variables of the plugin. There's a method on the craft.events variable, craft.events.getEventTypes(), which will return all event types.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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