Home › Forums › Calendar Products › Community Events › Preventing Multiple Categories in 'Submit an Event'
- This topic has 4 replies, 2 voices, and was last updated 6 years, 3 months ago by Yehuda.
-
AuthorPosts
-
December 5, 2017 at 11:33 pm #1399180YehudaParticipant
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.
December 7, 2017 at 7:45 am #1400314VictorKeymasterHi 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,
VictorDecember 7, 2017 at 10:35 pm #1400965YehudaParticipantHello Victor,
Only perfect! Thanks for the assist.
Cheers,
YehudaDecember 8, 2017 at 6:57 am #1401215VictorKeymasterHey 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 -
AuthorPosts
- The topic ‘Preventing Multiple Categories in 'Submit an Event'’ is closed to new replies.