Defaults Questions: Advanced

Home Forums Calendar Products Community Events Defaults Questions: Advanced

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #937063
    fiberartnow
    Participant

    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!

    #937570
    Barry
    Member

    Hi 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!

    #937603
    fiberartnow
    Participant

    I 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

    #937644
    Barry
    Member

    Hi 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 šŸ™‚

    #937647
    Barry
    Member
    #943010
    Barry
    Member

    Hi! 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!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Defaults Questions: Advanced’ is closed to new replies.