Home › Forums › Ticket Products › Event Tickets Plus › Simple page with public list of Attendees of a particular event
- This topic has 14 replies, 2 voices, and was last updated 8 years, 3 months ago by
Pablo.
-
AuthorPosts
-
November 10, 2017 at 2:08 am #1379719
Pablo
ParticipantHi, we want to create a page to see a list (table) with a public list of attendees.
Thanks in advance!
Pablo
November 10, 2017 at 11:09 pm #1380432Jennifer
KeymasterHi Pablo!
Are you looking to display all attendees for all events on one page, or do you want to create multiple pages that each display the attendees for a particular event?
This will likely require a customization, in which case our themer’s guide will be the place to start. However, if you can provide some more details on exactly what you’re looking for, I’ll be happy to point you in the right direction!
Thanks,
Jennifer
November 14, 2017 at 2:21 am #1382234Pablo
ParticipantThis reply is private.
November 14, 2017 at 9:11 am #1382700Jennifer
KeymasterHi Pablo,
Nice job with the customization! You should be able to change the order…can you send me a copy of what you did (preferably via GitHub gist link) and I’ll see what I can recommend?
Thanks,
Jennifer
November 14, 2017 at 9:45 am #1382726Pablo
ParticipantThis reply is private.
November 21, 2017 at 6:36 am #1387984Pablo
ParticipantHi again Jennifer, any answer?
Thanks in advance,
Pablo
November 29, 2017 at 5:52 am #1394713Jennifer
KeymasterHi Pablo,
So sorry for the delayed response, your thread didn’t show up on my end as waiting on a reply for some reason – sorry about that!
The attendee count and list are currently in the same template (wp-content/plugins/event-tickets-plus/src/views/attendees-list.php), so to separate them, you could do something like the following:
First copy the attendee list template into your child theme for editing by following these instructions. You can remove the code for the attendee list from that template and add the following to your single event template (which you will also want to copy into your child theme for editing) above the tribe-events-footer section:
-
$avatar_html ) { ?>
Let me know how this works for you and if you have any questions!
Thanks,
Jennifer
November 30, 2017 at 6:14 am #1395683Pablo
ParticipantHi Jennifer, works great!!! Thanks a lot!! only one more question… can I change avatar with attendee name??
Thanks in advance!!!
Pablo
November 30, 2017 at 8:32 am #1395780Jennifer
KeymasterHi Pablo,
I’m glad that worked for you! There is an example in this post where one of our developers added the attendee name below the avatar. If you’d like to remove the avatar entirely, you can simply comment out the following line from the example:
<?php //echo $avatar_html; ?>Since you’ve separated the attendee count, you’ll want to ignore that part of the template and just copy the attendee list part. This will modify/replace what you copied into your single event template – no need to modify your attendee-list.php file!
Let me know how it goes!
Thanks,
Jennifer
November 30, 2017 at 10:47 am #1395970Pablo
ParticipantHi Jennifer, I just copy you said below your code, like this:
<!-- Ateendees --> <ul class='tribe-attendees-list'> <?php if( class_exists( Tribe__Tickets_Plus__Attendees_List ) ) { $attendees_list = Tribe__Tickets_Plus__Attendees_List::get_attendees( $event_id ); foreach ( $attendees_list as $attendee_id => $avatar_html ) { ?> <li class='tribe-attendees-list-item'><?php echo $avatar_html; ?></li> <?php } } ?> </ul> <br> <h3>NEW CODE (BELOW) Do not show names only avatars</h3> <ul class='tribe-attendees-list'> <?php foreach ( $attendees_list as $attendee_id => $avatar_html ) { ?> <?php $attendee_name = ''; foreach ( $attendees as $key => $attendee_obj ) { if ( isset( $attendees[ $key ]['attendee_id'] ) && $attendee_id == $attendees[ $key ]['attendee_id'] ) { $attendee_name = $attendees[ $key ]['purchaser_name']; } } ?> <li class='tribe-attendees-list-item'> <?php echo $avatar_html; ?> <?php if ( ! empty( $attendee_name ) ) : ?> <br> <span class="tribe-attendees-list-item-name"> <?php echo $attendee_name; ?> </span> <?php endif ?> </li> <?php } ?> </ul> <!-- Ateendees END -->And names not show 🙁
December 5, 2017 at 7:07 am #1398569Jennifer
KeymasterHi Pablo,
I’m sorry it’s not working for you…can you try adding the following and see if this makes a difference? I tested this out on my end and was seeing the names and avatars:
-
$avatar_html ) { ?>
-
$attendee_obj ) {
if ( isset( $attendees[ $key ]['attendee_id'] ) && $attendee_id == $attendees[ $key ]['attendee_id'] ) {
$attendee_name = $attendees[ $key ]['purchaser_name'];
}
} ?>Let me know how it goes!
December 7, 2017 at 1:22 am #1400078Pablo
ParticipantSame problem, I only see avatars.
December 19, 2017 at 11:01 am #1408986Jennifer
KeymasterHi Pablo,
Sorry for the delay here, but I think I found the problem…if you’re adding this code to the single-events.php file, you’ll need to add this line:
<?php $attendees = Tribe__Tickets__Tickets::get_event_attendees( $event_id ); ?>You can add it above this line:
<?php foreach ( $attendees_list as $attendee_id => $avatar_html ) { ?>I tested this out in my single-event.php file and was getting the names…let me know if you get the same!
Thanks,
Jennifer
January 10, 2018 at 8:37 am #1422437Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
-
AuthorPosts
- The topic ‘Simple page with public list of Attendees of a particular event’ is closed to new replies.
