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?
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:
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 = ' — ' . $prev_answer_value . ' — '. $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 . ' ' . $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.
Support forum for Event Espresso 3 and Event Espresso 4.