Home › Forums › Calendar Products › Community Events › display organizers on venue page upcoming events list?
- This topic has 3 replies, 2 voices, and was last updated 10 years, 1 month ago by
Hunter.
-
AuthorPosts
-
February 26, 2016 at 2:53 am #1082345
divcom_uk
ParticipantHI there. Been working with your events calendar pro and i’ve come across a problem i can’t solve, wondered if there was a solution i’m missing.
I’ve managed to get the single organizer pages showing organizer info (even with some custom logic for multiple organizers- in this case ‘speakers’) in the loop of upcoming events, by rewriting the /list/single-event.php template, BUT i can’t do the same for the single venue page. am i missing something? examples here:
single organizer page with additional info in loop
Single venue page showing default infoI’ve tried changing the loop in the /day/ view and i’ve tried calling the organizer variables in the top of the single-venue page like so, in case it’s a question of that info just not being available for that page (i’ve even tried sticking it into /list/content.php just in case):
// Organizer $organizer_id = get_the_ID(); $organizer = tribe_get_organizer(); $organizer_ids = tribe_get_organizer_ids(); $multiple = count( $organizer_ids ) > 1;EDIT: in case it helps, the custom multiple organizer logic is as follows:
<?php do_action( 'tribe_events_single_meta_organizer_section_start' ); foreach ( $organizer_ids as $organizer ) { if ( ! $organizer ) { continue; } ?> <?php echo tribe_get_organizer_link( $organizer )?> <?php } if ( ! $multiple ) { // only show organizer details if there is one }//end if do_action( 'tribe_events_single_meta_organizer_section_end' ); ?>I’m just wondering where the venue page gets it’s loop and content from and where i’d need to put the template to override it?
Many Thanks!
PeteFebruary 27, 2016 at 10:29 am #1082940Hunter
ModeratorHello and welcome back 🙂
I took a look at the links provided and reviewed the code you’ve shared. After talking to some other team members, we came up with an example solution, but please note that this is just a basic example and we unfortunately won’t be able to help with further customizations: https://gist.githubusercontent.com/ggwicz/c7d1593c9e472ba50d08/raw/2e02c6909f7ddcef8b7f60b3db127a03258ee9fd/loop.php
You can modify the event list output for single-venue events by modifying src/views/tribe-events/list/loop.php in The Events Calendar.
I hope this helps and best of luck with the customizations. Have a great rest of your weekend and thanks for choosing PRO!
February 29, 2016 at 2:06 am #1083224divcom_uk
ParticipantBeautiful- that’s great service guys! i even managed to modify it to show multiple speakers with their links, using a hybrid of your loop and my original code- you’ve probably got a better handle on whether it’s any use to you or not- i don’t know how common our use case is, as we’re using it to schedule and describe seminars at large trade shows- but for me having multiple organizers listed for an event is REALLY useful as the speakers are the big draw- feel free to appropriate it for knowledgebase etc if it’s something that comes up again 😉
final code below:<?php /** * List View Loop * This file sets up the structure for the list loop * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/loop.php * * @package TribeEventsCalendar * */ if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } ?> <?php global $post; global $more; $more = false; ?> <?php /** * Custom organizer information if we're on a single-venue view. * * @link https://goo.gl/bABuFh */ $is_single_venue_page = tribe_is_venue(); ?> <div class="tribe-events-loop"> <?php while ( have_posts() ) : the_post(); ?> <?php do_action( 'tribe_events_inside_before_loop' ); ?> <!-- Month / Year Headers --> <?php tribe_events_list_the_date_headers(); ?> <!-- Event --> <?php $post_parent = ''; if ( $post->post_parent ) { $post_parent = ' data-parent-post-id="' . absint( $post->post_parent ) . '"'; } ?> <div id="post-<?php the_ID() ?>" class="<?php tribe_events_event_classes() ?>" <?php echo $post_parent; ?>> <?php /** * Custom organizer information if we're on a single-venue view. * * @link https://goo.gl/bABuFh */ if ( true == $is_single_venue_page ) : ?> <h3>Speaking: <?php //extra info $organizer = tribe_get_organizer(); $organizer_ids = tribe_get_organizer_ids(); $multiple = count( $organizer_ids ) > 1; foreach ( $organizer_ids as $organizer ) { if ( ! $organizer ) { continue; } ?> <?php echo tribe_get_organizer_link( $organizer )?> <?php } if ( ! $multiple ) { // only show organizer details if there is one }//end if ?></h3> <?php endif; ?> <?php tribe_get_template_part( 'list/single', 'event' ) ?> </div> <?php do_action( 'tribe_events_inside_after_loop' ); ?> <?php endwhile; ?> </div><!-- .tribe-events-loop -->March 1, 2016 at 7:34 pm #1084161Hunter
ModeratorHello again 🙂
Glad to hear you got it working and we’re ecstatic you’re pleased with our support! I’ll go ahead and close this thread out, but please open a new one if you have any more questions. Have a great week and thank you for choosing PRO!
-
AuthorPosts
- The topic ‘display organizers on venue page upcoming events list?’ is closed to new replies.
