Support

Home Forums Event Espresso Premium Displaying a Staff Picture on a Ticket

Displaying a Staff Picture on a Ticket

Posted: May 6, 2014 at 10:42 am


James Simon

May 6, 2014 at 10:42 am

Hello, I am trying to use the [ESPRESSO_STAFF] shortcode to display a staff picture on a ticket. I am using the ticket as a certificate for a course taught by an instructor. Currently, I have working shortcode in espresso-ticketing\templates\index.php that dynamically displays the student names, event names, and dates.

<p>[fname] [lname]</p>
<p> has successfully completed</p>
<p> [event_name] </p>
<p> on <span class=”course_date”>[start_date]</span></p>

I would like to add <p>[ESPRESSO_STAFF] </p> to display a picture of the instructor’s signature.

In the Staff Manager of Event Espresso I have created a staff member and included an image url. I then went to Event Overview and assigned that staff member to an event by checking the staff member’s name under Event Staff/Speaker.

When viewing the certificate for that event, it displays:

Student Name
Has successfully completed
Class Name
On Class Date
[espresso_staff]

At first, I attempted to create an if/else statement in index.php to dynamically change the signature based on the staff’s name, but I figured that [espresso_staff] should take care of that for me.

How can I properly call the espresso_staff shortcode in index.php to dynamically display the staff’s picture?

I read the documentation regarding the espresso_staff shortcode here:
https://eventespresso.com/wiki/shortcodes-template-variables/#staff_shortcode
According to the documentation, I should be able to “Just add [ESPRESSO_STAFF] to your event description.” Does this mean that I am unable to include it in index.php?

I also included <?php echo stripslashes_deep($data->event->espresso_staff) ?> in my html <title> tag in attempt to pull staff information.

Using the show_image parameter did not work for me either.

Will I need to add code to ee_default_event_meta in custom_functions.php to pull the staff image?


Josh

  • Support Staff

May 6, 2014 at 1:44 pm

Hi James,

You can add the staff shortcode to the ticket template with the following code:

<?php echo do_shortcode('[ESPRESSO_STAFF event_id="' . $data->attendee->event_id . '"]'); ?>


James Simon

May 7, 2014 at 8:31 am

Thank you Josh!

I also added the following code to my style to hide the staff’s name.

<pre class=”brush: css; gutter: true; first-line: 1; highlight: []; html-script: false”>
.person_name {
display: none;
}


James Simon

May 7, 2014 at 8:33 am

<pre class=”brush: css; gutter: true; first-line: 1; highlight: []; html-script: false”>.person_name {
display: none;
}

The support post ‘Displaying a Staff Picture on a Ticket’ 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