Posted: August 14, 2018 at 1:51 pm
|
I want to add more than just the person’s name on a page using the shortcode: [ESPRESSO_EVENT_ATTENDEES] Since I am not a developer, is there a way of doing this without having to write PhP? For example, can we add a parameter within the shortcode, say for example, the Website of the person? (assuming they provided their website when they registered.) Thanks for your help, |
Hi Don, I checked and I’m afraid parameters like those do not exist: https://eventespresso.com/wiki/ee4-shortcodes-template-variables/#event-attendees The above link to the documentation does include some information about how to customize the templates using PHP. If you can team up with a PHP developer then the example outlined in the documentation can be followed. |
|
|
Hi Josh Thanks for the reply. From your documentation: 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 Can we use PhP Plugins like: PHP code snippets (Insert PHP) Thanks, |
No the plugins like those do not work with the templates. Instead you add PHP directly into the template file in the child theme folder. |
|
|
Josh If the theme is updated, do we lose the manually entered PhP code? Thanks, |
Hi Don, The documentation says to use a child theme. So when the parent theme is updated, you will not lose your changes. There’s more information about why to use child themes in the WordPress codex: |
|
|
Hi Josh OK – I have copied the content-espresso_event_attendees.php to the theme and inserted the code below for reference. Just to see if it worked, I copied the line of code: and it worked as expected. It displayed the contact name twice. Question – what line of PhP code should I add to include the Website and Email address of the person who registered for the event? Thanks for your help, <?php do_action( ‘AHEE__content-espresso_event_attendees__after’, $contact, $show_gravatar ); ?> |
Hi Don, For the answer to the website question, you’ll follow this example: https://gist.github.com/joshfeck/63fe625950c9a71e19be You’ll note that you’ll need to change line 19 to match your website question’s ID. Then, |
|
|
Hi Josh Thanks – that worked. Another question – where can I find all of the available variables like: $contact->email() for the website, company name, etc.? Thanks, |
Hi Don, Since website, company name, etc. are not system questions, there are no variables for them. The reason there’s a method for the email address is because it’s a system question. |
|
|
Hi Josh Sorry for the dumb questions: 1. What are the “system question variables”? Or, where can I find them? Thanks for your continued help, |
They’re not actually system question “variables”. They’re system questions and you can find the system questions in Event Espresso > Registration Form > Questions. The system questions are the questions that are added by default (First Name, Last Name, Email, and the Address questions).
This example code shows an example of a way to display the non-system question answers: |
|
|
Just to follow on with this question of ‘variables’ The tickets template has for e.g. I’d like the $attendee->Reference() if this exists? |
Hi, I’m not familiar with a booking reference number. Do you mean the registration ID, the reg. link URL, or the reg. code? |
|
|
Hi, Sorry – Registration ID and the Registration Code please! Thanks |
You’ll actually need to loop through the registrations to get those. So for example your content-espresso_event_attendees.php template could look something like this:
|
|
The support post ‘[ESPRESSO_EVENT_ATTENDEES] – want more info than just the person's name’ 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.