Support

Home Forums Event Espresso Premium Event Attendees

Event Attendees

Posted: October 2, 2020 at 12:46 am


ridos

October 2, 2020 at 12:46 am

Hello, I would like to add to my site attendees list with answers to the questions from the registration form. The standard list have only time and nothing else ๐Ÿ™
Here is attendees list: https://rfc.com.pl/lista-startowa/
Here is registration form page: https://rfc.com.pl/events/rfc/

I would like to show: full name, team name, vehicle brand and start class. Can you help me please?


Tony

  • Support Staff

October 2, 2020 at 6:51 am

Hi there,

As EE allows you to add custom questions that can be used for pretty much anything at all into the registration form, the safest often is to only output the minimal amount of data.

If you are comfortable with PHP you can add additional answers to the output by modifying the template used and we have an example of doing so here:

https://gist.github.com/joshfeck/63fe625950c9a71e19be


ridos

October 5, 2020 at 5:45 am

Ok, but I can add only one Custom question’s ID ๐Ÿ™ and always only the second one working :/

array(
	'Registration.ATT_ID' => $contact->ID(),
	'Registration.EVT_ID' => $event->ID(),
	'QST_ID' => 20, // replace with custom question's ID
	'QST_ID' => 15 // replace with custom question's ID
				),


Tony

  • Support Staff

October 5, 2020 at 6:06 am

You’ll need to pull each individual answer separately:

$vehicle_brand = EEM_Answer::instance()->get_var( 
    array(
        array(
            'Registration.ATT_ID' => $contact->ID(),
            'Registration.EVT_ID' => $event->ID(),
            'QST_ID' => 20 // replace with vehicle brand custom question's ID
        ),
        'order_by' => array(
            'ANS_ID' => 'DESC'
        ),
        'limit' => 1
    ),
    'ANS_value' 
);

$start_class = EEM_Answer::instance()->get_var( 
    array(
        array(
            'Registration.ATT_ID' => $contact->ID(),
            'Registration.EVT_ID' => $event->ID(),
            'QST_ID' => 15 // replace with start class custom question's ID
        ),
        'order_by' => array(
            'ANS_ID' => 'DESC'
        ),
        'limit' => 1
    ),
    'ANS_value' 
);


ridos

October 5, 2020 at 6:09 am

Ok worked this out. I did this and worked. You can add this to custom templates.

<?php
/**
 * Content Template for the [ESPRESSO_EVENT_ATTENDEES] shortcode
 *
 * Please be sure to change the Question ID on line 19 to match your custom Question ID
 *
 * Template Args that are available in this template
 * @type EE_Attendee $contact
 * @type EE_Event   $event
 * @type bool       $show_gravatar  whether to show gravatar or not.
 */
$custom_question_output = '';
if( $contact instanceof EE_Attendee ) {
	$prev_answer_value = EEM_Answer::instance()->get_var( 
			array(
				array(
					'Registration.ATT_ID' => $contact->ID(),
					'Registration.EVT_ID' => $event->ID(),
					 'QST_ID' => 15, // replace with custom question's ID
				),
				'order_by' => array(
					'ANS_ID' => 'DESC'
				),
				'limit' => 1
			),
			'ANS_value' );
	$next_answer_value = EEM_Answer::instance()->get_var( 
			array(
				array(
					'Registration.ATT_ID' => $contact->ID(),
					'Registration.EVT_ID' => $event->ID(),
					 'QST_ID' => 20, // replace with custom question's ID
				),
				'order_by' => array(
					'ANS_ID' => 'DESC'
				),
				'limit' => 1
			),
			'ANS_value' );
	}
	if( $prev_answer_value ) {
		$custom_question_output = ' &mdash; ' . $prev_answer_value . ' &mdash; '.  $next_answer_value;
	}
	
if ( $show_gravatar ) {
	$gravatar = get_avatar( $contact->email(),
		(int) apply_filters( 'FHEE__loop-espresso_attendees-shortcode__template__avatar_size', 32 )
		);
} else {
	$gravatar = '';
}
?>
<?php do_action( 'AHEE__content-espresso_event_attendees__before', $contact, $show_gravatar ); ?>
<li><?php echo $gravatar . '&nbsp;' .  $contact->full_name() . $custom_question_output; ?></li>
<?php do_action( 'AHEE__content-espresso_event_attendees__after', $contact, $show_gravatar ); ?>

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  ridos 3 weeks ago ago

Topic Tags

Notifications

This topic is: 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/event-attendees-3/'> <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]