Support

Home Forums Event Espresso Premium Event Attendees (3)

Event Attendees (3)

Posted: October 2, 2020 at 12:46 am

Viewing 4 reply threads


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 ); ?>
Viewing 4 reply threads

The support post ‘Event Attendees (3)’ 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