Support

Home Forums Event Espresso Premium Customize Attendee List

Customize Attendee List

Posted: July 5, 2017 at 6:25 pm


BoostersInABox

July 5, 2017 at 6:25 pm

I found the instructions on how to do this, but it references a .php file that does not exisespresso_event_attendees.php is not in that folder for EE4. Please advise.

How to customize the Attendee list templates
Step 1: Copy the espresso_event_attendees.php template from the /event-espresso-core-reg/public/Espresso_Arabica_2014/ folder to your WordPress child theme’s folder.
The main template’s name is content-espresso_event_attendees.php. If you need to modify the loop, you can copy loop-espresso_event_attendees.php.
Step 2: Make your modifications to the templates that you copied to your theme.


Tony

  • Support Staff

July 6, 2017 at 3:52 am

Hi there,

There are multiple template files that make up the output, so the docs are trying to be general as it depends on what you want to change.

espresso_event_attendees.php is referring to either:

content-espresso_event_attendees.php or loop-espresso_event_attendees.php

loop-espresso_event_attendees.php basically pulls all of the contacts in and sets up the container. It then calls content-espresso_event_attendees.php for each contact to output the details, so…

content-espresso_event_attendees.php is the file that outputs the details for each single contact, if the $contact object has all of the info you need to output this is the file you copy over and change.

Can you let me know what it is your trying to change/output?


BoostersInABox

July 6, 2017 at 9:25 am

I am trying to customize the attendee list template per the instruction on this page: https://eventespresso.com/wiki/ee4-shortcodes-template-variables/#event-attendees

Here is the page: http://www.vhsvipers.com/football/v83117/

I am trying to code to the templates to display information obtained from the registration questions.


BoostersInABox

July 6, 2017 at 9:26 am

I did copy over content-espresso_event_attendees.php into my child theme template. No changes to the output, so it does not appear to be reading that file.


Josh

  • Support Staff

July 6, 2017 at 9:50 am

The name of the file needs to be an exact match of the original, and you’ll need to make sure it’s in the root/main level of the child theme folder. in other words, if your child theme has folders, the file cannot be located inside one of the folders.


BoostersInABox

July 6, 2017 at 9:59 am

It is an exact match and is in the root/mail level.


Josh

  • Support Staff

July 6, 2017 at 10:13 am

There’s also some caching involved with that particular shortcode. You can make sure you’re not viewing cached content by setting the cache expiration for the Attendee shortcode to 0.

add_filter(
  'FHEE__EventEspresso_core_services_shortcodes_EspressoShortcode__shortcodeContent__cache_expiration',
  'my_custom_shortcode_cache_expiration',
  10,
  3
);
function my_custom_shortcode_cache_expiration( $cache_expires, $get_tag, $shortcode) {
  if ( $get_tag == 'ESPRESSO_EVENT_ATTENDEES' ) {
    $cache_expires = 0;
  }
  return $cache_expires;
}

You can add the above to a functions plugin, then activate the plugin. After the plugin is activated, the list will no longer be served from a cache.


BoostersInABox

July 6, 2017 at 10:33 am

Josh,
That was the issue. The functions plugin worked! What I am finding is that it is only for the additional questions, not any of the system questions (1-10). So, if I wanted to add Q3 (email) & Q10 (phone), this code won’t work. I also discovered that it only works on additional/custom questions that are text only. Is that true as well? Two of mine are selection questions. The result was something like this:

Michelle Jones — a:1:{i:0;s:4:”11th”;}
Laurie Moore — a:1:{i:0;s:4:”12th”;}


Josh

  • Support Staff

July 6, 2017 at 10:49 am

Hi there,

The system questions are actually stored elsewhere so your code to retrieved those will be different. For example the phone number can be retrieved with:

$contact->get( 'ATT_phone' );

I also discovered that it only works on additional/custom questions that are text only. Is that true as well?

Not exactly. Some of the question types are multiple choice so the answer is formatted as an array. In which case you will need to loop through the array to display the answer value(s).

The support post ‘Customize Attendee List’ 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