Home › Forums › Calendar Products › Community Events › Defaults Questions: Advanced
- This topic has 5 replies, 2 voices, and was last updated 9 years, 2 months ago by Barry.
-
AuthorPosts
-
January 24, 2015 at 5:03 am #937063fiberartnowParticipant
I’d like to limit the descriptions to 100 words (600 characters?), to disable the reoccurring events option, and pre-select the 2 google maps check boxes. Please advise. Thanks!
January 26, 2015 at 7:14 am #937570BarryMemberHi fiberartnow,
Some great questions!
Please note that to ensure fair service to all of our customers – and also to make topics like this useful and easily digestable to other users searching for similar things in the future – we ask that you stick to one issue per topic.
With that in mind, let’s focus on your first query and if you can create new topics for your other questions that would be appreciated š
Iād like to limit the descriptions to 100 words (600 characters?)
Can you confirm where you want to apply this?
Also, if you haven’t already done so, I would strongly recommend reading through our Themer’s Guide to learn some of the basics of customizing The Events Calendar š
Thanks!
January 26, 2015 at 7:48 am #937603fiberartnowParticipantI want to have a limit on the form that users fill out, to post their events, on this page: http://fiberartnow.net/events/community/add#.VMZhd3Yb6MZ
Please advise. Thank you for your help. Best, Marcia
January 26, 2015 at 8:47 am #937644BarryMemberHi Marcia,
So there are several ways to tackle this – you could choose to follow just one approach or combine them all for more complete coverage.
The first idea that comes to mind is you could use Javascript to count the number of words/characters and, as soon as the customer gets close, flag up a warning and prevent them from submitting the form. This is a nice strategy because the customer gets realtime feedback.
Such a Javascript-based approach might be all you need, in reality, however it’s arguably not a complete answer because JS may not be enabled in a client browser (not so likely these days, but you never know) or may not run due to problems in other scripts outwith your control. Additionally, a knowledgeable person could subvert any JS-driven checks quite easily – though in practice you may find such attempts are infrequent.
With that in mind, you may also wish to implement server-side checks. Thankfully, Community Events has everything you need to do this gracefully and feedback any problems to the user.
- The tribe_community_events_validate_submission filter lets you assess the submitted information and you could use this to reject submissions with overly long descriptions
- The best way to understand this hook is to check out the source: take a peek at tribe-community-events/Submission_Handler.php and the validate() method in particular
- You can use a further filter hook – tribe_events_community_submission_message – to report back any error messages to the customer
Regrettably we don’t have too much documentation in this area so – at least for the time being – working through the code is the best way to get to grips with things.
I hope that helps š
January 26, 2015 at 8:49 am #937647BarryMember…This knowledgebase article might of interest:
theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form
February 17, 2015 at 6:40 am #943010BarryMemberHi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!
-
AuthorPosts
- The topic ‘Defaults Questions: Advanced’ is closed to new replies.