Preventing Multiple Categories in 'Submit an Event'

Home Forums Calendar Products Community Events Preventing Multiple Categories in 'Submit an Event'

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1399180
    Yehuda
    Participant

    Hello, I am having good success with Submit an Event.

    I have a requirement to restrict the user from selecting multiple categories in their events. That is: Required to select one category but no more than one. I was able to set the field to ‘required’.

    Is there a method available to code this up together with the ‘required’ flag?

    Cheers,
    Yehuda

    • This topic was modified 6 years, 3 months ago by Yehuda.
    #1400314
    Victor
    Keymaster

    Hi Yehuda!

    Thanks for getting in touch with us! Let me help you with this topic.

    First, please let me note that we are fairly limited in how much support we can give for custom development questions like that.

    That said, we always like helping out and at least point users into the right direction as much possible.

    I would suggest overriding the taxonomy.php template to make that happen. You can learn more about overriding calendar templates in our Themer’s Guide, but it basically boils down to this:

    • Make a copy of the taxonomy.php template. It is located at wp-content/plugins/the-events-calendar-community-events/src/views/community/modules/taxonomy.php
    • Make a new folder in your theme called tribe-events
    • Make a new folder in that one called community and another on inside it called modules
    • Drop your copied taxonomy.php file in that last folder

    Now that the template is in your theme, you can modify it to suit your needs. In this case, You should delete line 91 which is the attribute “multiple” that allows for multiple selection of categories.

    Will this work for you? Please let me know. 🙂

    Best,
    Victor

    #1400965
    Yehuda
    Participant

    Hello Victor,

    Only perfect! Thanks for the assist.

    Cheers,
    Yehuda

    #1401215
    Victor
    Keymaster

    Hey Yehuda!

    Glad to be of help! 🙂

    I’ll close this now, but feel free to open a new topic if anything comes up and we’ll be happy to help.

    Cheers,
    Victor

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Preventing Multiple Categories in 'Submit an Event'’ is closed to new replies.