Support

Home Forums Event Espresso Premium Can you add custom fields to the my events short code"

Can you add custom fields to the my events short code"

Posted: June 20, 2020 at 12:03 pm


greg@successteam1.com

June 20, 2020 at 12:03 pm

Is it possible to include custom links to the [ESPRESSO_MY_EVENTS] for virtual events.

See: https://share.vidyard.com/watch/RsGj37uPvjTEeM3LaF1Xwx?

We only show this on our members only page. This would make it really easy for members to login and get links to virtual meetings.


Tony

  • Support Staff

June 22, 2020 at 5:35 am

Hi there,

Yes, it’s possible but the way you do it differs depending on where you want to include the details.

It looks like you want to include it on the date/time section, assuming making that section a link? If so that will require you load a couple of custom templates for the my events section and modify those.

Without loading custom templates the other option is to add another ‘action’ to the actions section with your own icon.

If you let me know which you prefer I can add more details on how you go about doing either.


greg@successteam1.com

June 23, 2020 at 8:18 am

Hey sorry for the delay, forgot to tic the box to notify me. I’m open to adding custom templates. Let’s go that route


Tony

  • Support Staff

June 23, 2020 at 12:10 pm

Ok, so you want to wrap the date with the link you have set in custom fields?

I’m open to adding custom templates.

Note that by loading your own custom templates, you take responsibility of keeping those templates updated as we update the default templates.

The first template you need is:

\eea-wpuser-integration\templates\content-espresso_my_events-event_section.template.php

Grab that template and place a copy in the root directory of your theme (preferably a child theme).

The template in the root directory can now be edited as it will be used in place of the original. Around line 115 you’ll have:

$template_args = array('registration' => $registration);

Change that to:

$template_args = array('registration' => $registration, 'event' => $event);

That passes the current event to the template used to output the date. (You could pull this for each registration but this is more efficient)

Now grab \eea-wpuser-integration\templates\content-espresso_my_events-event_section_tickets.template.php

Place that in your themes root directory again.

The EE_Event object has a get_post_meta($meta_key = '', $single = true); method (its a wrapper for WP get_post_meta()) so you can pull custom fields using:

$value = $event->get_post_meta($meta_key, true);

So for example:

$zoom_url = $event->get_post_meta('zoom_url', true);

$zoom_url will be whatever the value was you set on the field.

Now just wrap line 16 with an a tag using your zoom URL as the href and your done.


greg@successteam1.com

July 13, 2020 at 2:01 pm

OK almost have it. The last part about the “EE_Event object” the file I’m updating is the file “content-espresso_my_events-event_section.template.php” located in the theme directory? Or I’am I updating the file in the plugin directory?


Tony

  • Support Staff

July 13, 2020 at 4:35 pm

Or I’am I updating the file in the plugin directory?

The answer to that question is almost always no, if you edit core files the modification ill be lost each and every time the plugin (or theme if your modifying a theme and not using a custom/child theme).

The last part about the “EE_Event object” the file I’m updating is the file “content-espresso_my_events-event_section.template.php” located in the theme directory?

Your copy the template into your themes root directory so that file is used in place of the default one, so you are editing the version in your theme’s root directory.


greg@successteam1.com

August 13, 2020 at 7:38 am

Hey I’ve worked on this but could not get it to work… Can I hire you to set this up on our account. If so what is the cost. Thank you in advance for your help.


Tony

  • Support Staff

August 13, 2020 at 9:29 am

To clarify what you need, is it basically the steps posted here?

https://eventespresso.com/topic/can-you-add-custom-fields-to-the-my-events-short-code/#post-313394

If so we could likely create the template for you for a support token:

https://eventespresso.com/product/premium-support-token/


greg@successteam1.com

August 13, 2020 at 12:04 pm

This reply has been marked as private.


Tony

  • Support Staff

August 14, 2020 at 5:15 am

Can what I’m asking be done in 30 min?

I don’t know because it’s not really clear what you need us to do yet.

Can THIS be done within 30mins? Yes, I can make the templates pass the registration object through and pull a custom meta value in that timeframe. But without getting in to see the code and any changes made I don’t know what needs to be done.

What will I have to do with the template? Will it be installed for me?

If you provide FTP details then yes the template can be installed, I’m assuming you already have a child theme?


greg@successteam1.com

August 14, 2020 at 5:28 am

This reply has been marked as private.


greg@successteam1.com

August 14, 2020 at 6:35 am

This reply has been marked as private.


Tony

  • Support Staff

August 14, 2020 at 7:13 am

Yeah, we can do that.

To redeem your support token go you your account page on the right is a redeem support token link, click that and provide the details request

You must be logged in to reply to this support post. Sign In or Register for an Account

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3 Documentation for Event Espresso 4

Status: publish

Updated by  Tony 1 month, 2 weeks ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[gravityform id=80 title=false description=false ajax=false]
<div class='gf_browser_unknown gform_wrapper' id='gform_wrapper_80' ><form method='post' enctype='multipart/form-data' id='gform_80' action='/topic/can-you-add-custom-fields-to-the-my-events-short-code/'> <div class='gform_body'><ul id='gform_fields_80' class='gform_fields top_label form_sublabel_below description_below'><li id='field_80_1' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_1' >First name<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_text'><input name='input_1' id='input_80_1' type='text' value='' class='medium' aria-required="true" aria-invalid="false" /></div></li><li id='field_80_2' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_2' >Email address<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_email'> <input name='input_2' id='input_80_2' type='email' value='' class='medium' aria-required="true" aria-invalid="false" /> </div></li><li id='field_80_3' class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' >GDPR Agreement<span class='gfield_required'>*</span></label><div class='ginput_container ginput_container_checkbox'><ul class='gfield_checkbox' id='input_80_3'><li class='gchoice_80_3_1'> <input name='input_3.1' type='checkbox' value='I consent to have this website store my submitted information so they can respond to my inquiry.' id='choice_80_3_1' /> <label for='choice_80_3_1' id='label_80_3_1'>I consent to have this website store my submitted information so they can respond to my inquiry.</label> </li></ul></div></li><li id='field_80_4' class='gfield gform_validation_container field_sublabel_below field_description_below gfield_visibility_visible' ><label class='gfield_label' for='input_80_4' >Name</label><div class='ginput_container'><input name='input_4' id='input_80_4' type='text' value='' autocomplete='off'/></div><div class='gfield_description' id='gfield_description_80_4'>This field is for validation purposes and should be left unchanged.</div></li> </ul></div> <div class='gform_footer top_label'> <input type='submit' id='gform_submit_button_80' class='gform_button button' value='Download Now' onclick='if(window["gf_submitting_80"]){return false;} if( !jQuery("#gform_80")[0].checkValidity || jQuery("#gform_80")[0].checkValidity()){window["gf_submitting_80"]=true;} ' onkeypress='if( event.keyCode == 13 ){ if(window["gf_submitting_80"]){return false;} if( !jQuery("#gform_80")[0].checkValidity || jQuery("#gform_80")[0].checkValidity()){window["gf_submitting_80"]=true;} jQuery("#gform_80").trigger("submit",[true]); }' /> <input type='hidden' class='gform_hidden' name='is_submit_80' value='1' /> <input type='hidden' class='gform_hidden' name='gform_submit' value='80' /> <input type='hidden' class='gform_hidden' name='gform_unique_id' value='' /> <input type='hidden' class='gform_hidden' name='state_80' value='WyJbXSIsIjBiNjdjZjkyMDUzOWUxOWY5Y2NiZjIwMzM4YjA1Mjk4Il0=' /> <input type='hidden' class='gform_hidden' name='gform_target_page_number_80' id='gform_target_page_number_80' value='0' /> <input type='hidden' class='gform_hidden' name='gform_source_page_number_80' id='gform_source_page_number_80' value='1' /> <input type='hidden' name='gform_field_values' value='' /> </div> </form> </div><script type='text/javascript'> jQuery(document).bind('gform_post_render', function(event, formId, currentPage){if(formId == 80) {} } );jQuery(document).bind('gform_post_conditional_logic', function(event, formId, fields, isInit){} );</script><script type='text/javascript'> jQuery(document).ready(function(){jQuery(document).trigger('gform_post_render', [80, 1]) } ); </script>
[i]
[i]