Support

Home Forums Event Espresso Premium Adding easy-to-use custom fields to 'Add Event'?

Adding easy-to-use custom fields to 'Add Event'?

Posted: July 10, 2013 at 9:00 am


Peter

July 10, 2013 at 9:00 am

Hi,

I’ve just bought EventEspresso and I’m excited to be using it! However, I’ve immediately run into one feature which I thought was present from reading the ‘Features’ page, but on re-reading appears strangely missing: Custom Event fields (not custom registration fields).

For example, the ability to create:

An extract, so admins can enter a custom summary to appear on the event listing page (wysiwyg)As you can with standard WP pages/posts
“Is lunch provided?” yes/no (dropdown)
“Who’s the event for?”, to display on the event listing page and event details page (text input)
“Audience” (text input)

You get the idea. I’m trying to customise the listing page more and prevent my clients from having to insert tables into the main content area and format them correctly.

This is fairly crucial functionality for me; we’re migrating an existing site to WordPress and the events pages have fixed formats. Is there anything I can do to add custom fields?

I’ve been spoiled using Advanced Custom Fields on built-in and Custom Post Types, and I guess my dream would be to use it on the ‘Add/Edit’ Event screen.

Also, is there a way to put registration forms on their own URL, rather than embedded at the bottom of the event details page?

Thanks!

———————————————
> What is your WordPress version?
3.5.2

> What are the versions of Event Espresso and the installed add-ons?
Event Espresso version 3.1.33.3.P

> Is this a new installation, or one that was recently upgraded?
Brand new

> If your site is online, please include a link to the registration page.
Sorry, under development, but can provide access to the support team


Peter

July 10, 2013 at 9:02 am

I did format it with UL and LI tags, but they have been stripped and turned into paragraphs 🙁 “An extract” should start a list.


Josh

  • Support Staff

July 10, 2013 at 10:07 am

Hi Peter,

In 3.1, custom fields can be added to the add event screen by using the ee meta box feature:

https://eventespresso.com/wiki/shortcodes-template-variables/#ee-meta

The only limitation with the ee meta box is they are not wysiwyg. To add a second wysiwyg editor box would require custom development in 3.x.

The dev team is hard at work bringing support for custom post types to events for 4.x, so plugins like Advanced Custom Fields should work to make for new custom fields for the event editor.

You can place registration forms on their own URL’s by using either the ESPRESSO_REG_PAGE or the ESPRESSO_REG_FORM shortcode:

https://eventespresso.com/wiki/shortcodes-template-variables/#reg-page


Peter

July 11, 2013 at 2:19 am

Thanks for your reply Josh. The ee meta box is not client-friendly enough, which leaves hacking the plugin as an alternative (and bad) option. Is there a beta version of 4.X available yet? I was surprised to discover on install that EE didn’t use custom post types, as I hadn’t seen this stated prior to purchase.

Thanks for the information on separate registration pages, I will look into this now.


Josh

  • Support Staff

July 11, 2013 at 9:40 am

Hi Peter,

I’m sorry to hear this. With the exception of the custom summary box, would it work to add the other fields:

“Is lunch provided?”, “Who’s the event for?”, and “Audience” as defaults in the meta fields, along with default values?

Also, if you’re okay with using the feature that adds a espresso_event post for each event (documented here: https://eventespresso.com/wiki/custom-post-types-basic-setup/ ) you can use advanced custom fields to add the wysiwyg metabox.

I admit it takes a bit more work to make this happen in 3.x as it doesn’t support custom post types as well as 4.x will, but if you’d like to look into using what’s available now we’re here to help.

To answer your question about the 4.0 beta, yes there is a beta for 4.0 that can be downloaded from your account page (you can opt-in to the pre-release to get access to the pre-releases). However, the CPT conversion didn’t get started until 4.1, which is still under heavy development.

If you’d like to see the work that’s going into 4.1 you can sign up for github access here:

https://eventespresso.com/developers/request-repo-access/

The custom post type work that’s currently happening can be reviewed in the development branch there on github. The database part of the CPT conversion is currently under active development, but you’ll be able to see a rough approximation of what will be in 4.1, which in your case you’ll likely appreciate how it’s using WP’s advanced-edit-post.php template, WP native custom fields, autosave (revisions), and wp_list_tables for the event and attendee overview screens. So much of the admin is being overhauled to allow for more flexibility and customization.


Peter

July 15, 2013 at 9:46 am

Hi Josh,

work to add the other fields […] as defaults in the meta fields, along with default values?

It would work, but it’d be a sub-par experience for the client.

Also, if you’re okay with using the feature that adds a espresso_event post for each event (documented here: https://eventespresso.com/wiki/custom-post-types-basic-setup/ ) you can use advanced custom fields to add the wysiwyg metabox.

Now I had a play with this (originally thinking it’d convert the events to custom post types) and ended up scratching my head as to how it’d be useful, as the events are already in the system, so why would I need to duplicate them elsewhere? But I get how they could be used now as the ‘public’ page for the event. As I see it the user workflow would end up being something like this?

User creates event
User publishes CPT page for event automatically
User goes and edits CPT page
User realises the original event details are wrong
User goes back and edits them
User realises the CPT page needs updating to match

But it could be workable for now. I need to try on my copy of EE and see just how effective it could be – and if the client can manage it without getting it wrong when they add new events every couple of months.

4.1 sounds a great improvement and I look forward to seeing (and using) it. Is there any measure of when it’s likely to be ready – 3 months, 6 months, 12 months, 18 months+?


Josh

  • Support Staff

July 16, 2013 at 12:49 pm

Hi Peter,

The scenario you outline here:

As I see it the user workflow would end up being something like this?
User creates event
User publishes CPT page for event automatically
User goes and edits CPT page
User realises the original event details are wrong
User goes back and edits them
User realises the CPT page needs updating to match

This could indeed happen because they’re dealing with two separate screens, which really isn’t the best and could end up being confusing. It was only an idea to make it possible to use the ACF plugin with 3.x.

With customizing the native event editor:

I checked through some of the code that handles the meta boxes (starts on line 338 of /includes/admin-files/functions.php) and it turns out that the function that builds the Event meta box is a pluggable function. So one thing you could do is copy this into /wp-content/uploads/espresso/custom_functions.php and edit it there.

This avoids directly editing any core files.

What you then could do is remove the more dynamic features of the meta editor (eg. the ability to add and remove key value pairs, the part that displays the key dropdown selector) and add in your own static meta fields. You may even be able to use the wp_editor function to add in a WYSIWYG textarea.

With 4.1. The 4.0 beta was made available as pre-release for testing, and there was quite a bit of useful feedbac. One of the things thats really came to light was the need for converting things like events to be Custom post types. It was decided to convert these over sooner than later. So the idea is ship in 4.1 instead of converting these over in 4.2 or 4.3 and dealing with converting data from 3.x and 4.1 to 4.2/4.3. With that and some other setbacks the dev cycle for 4.1 has been extended. At this time I do not have an realistic estimate of how long it will be before 4.1 will be ready for production use. I’m afraid there are too many unknowns at this point.

The support post ‘Adding easy-to-use custom fields to 'Add Event'?’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso