Customizing submission form fields

Home Forums Calendar Products Community Events Customizing submission form fields

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #45077
    Ken
    Participant

    Hi! I just started using Community Events and have some questions about customizing the event submission form:

    • Can I make certain fields required? (such as organizer name and email, but not phone or Web site)

    • Is there a way to exclude fields from the submission form? Specifically:

    – Categories
    – Show Google Maps Link
    – Show Google Map

    • Can I allow non-image files to be uploaded? (ie, PDFs)

    • Finally, this code in my theme’s functions.php file puts the author’s bio at the bottom of a post: http://pastebin.com/QyPxzSi6 How can I modify it so that the community event submission form doesn’t conclude with my bio?

    #45284
    Barry
    Member

    Hi Ken,

    Great questions!

    Can you make certain fields required? Definitely possible but unfortunately there aren’t any particularly easy routes to help you accomplish this. If you have a good working knowledge of either PHP or Javascript you might be able to jury rig something here.

    I believe Casey has proposed this as an option for the devs to consider in a future version, as yet it’s not been either accepted or declined as a new feature however.

    To hide fields such as the category selection (though I admit this isn’t the most elegant solution) you could default to a little CSS:

    #EventInfo { display: none; }

    And for the Google Maps fields:

    #google_map_link_toggle { display: none; }

    And for the show map option:

    #google_map_toggle { display: none; }

    It may be possible to prevent that markup from being sent to the browser altogether and that would arguably be a better solution; however it’s beyond the scope of support to help with that.

    To allow non-image files to be uploaded, once again, is possible but it’s beyond the scope of what we can help you with. The acceptable file types are hard-coded in place and cannot be filtered, so you’d have to get creative and accept the uploaded file independently of Community Events and then determine the ID of the newly created event and attach it that way.

    Last but not least, how can you avoid inserting the biog info on the community events pages … I’m not sure off the top of my head so bear with me while I check in with the dev team – I’ll update you as soon as I can.

    Thanks!

    #45289
    Barry
    Member

    Hi again Ken – can you take a look at Jonah’s answer (the second post) in this thread?

    https://theeventscalendar.com/support/forums/topic/community-add-template/#post-32838

    Those template tags could be useful for your final point.

    #45706
    Ken
    Participant

    Barry,

    Thanks for all the great replies! Sorry it’s taken me awhile to work through them.

    I was able to remove the fields I wanted hidden through template overrides, by deleting them from custom event-form.php and events-meta-box.php files. The only change I couldn’t make through template overrides was to the “Organizer Details” fields. I wanted to change the word “Organizer” to “Team”, but this could apparently only be done by editing the events-calendar-pro.php file directly, which will of course be wiped out with the next update. Hmm.

    Sorry to hear PDFs can’t be uploaded through the form. Many of my community events come with coupons or flyers to print out. I’ll have to find another way to accept those files.

    The template tags you linked to worked great to exclude author bios from the event submission page — thanks!

    A new question: can I set the default author for submitted events?

    -Ken

    #45715
    Barry
    Member

    The only change I couldn’t make through template overrides was to the “Organizer Details” fields.

    One workaround, if you are familiar with (or don’t mind experimenting with) language/translation files is to set up an English translation and change the wording that way.

    #45716
    Ken
    Participant

    Neat idea, Barry. Are those files not overwritten with each update?

    #45717
    Barry
    Member

    Regarding the setting of a default author, you could try adding a snippet like this (ensuring you change the author ID from 2 to whatever is appropriate) to your theme’s functions.php file.

    #45718
    Ken
    Participant

    It worked! 😀 Thanks, Barry!

    #45719
    Barry
    Member

    Neat idea, Barry. Are those files not overwritten with each update?

    Good point 🙂

    Possibly you can direct WordPress to use a different location (ie, outside of the plugin directory) when the text domain is loaded; or, alternatively, all translatable strings can also be filtered.

    Although you probably don’t want a filter running for every single translated string (since you only want to change a single item) you could set this up from within a template override then remove it immediately after it has served its purpose.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Customizing submission form fields’ is closed to new replies.