display organizers on venue page upcoming events list?

Home Forums Calendar Products Community Events display organizers on venue page upcoming events list?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1082345
    divcom_uk
    Participant

    HI 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 info

    I’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!
    Pete

    • This topic was modified 10 years, 2 months ago by divcom_uk.
    • This topic was modified 10 years, 2 months ago by Hunter.
    • This topic was modified 10 years, 2 months ago by Hunter.
    #1082940
    Hunter
    Moderator

    Hello 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!

    #1083224
    divcom_uk
    Participant

    Beautiful- 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 -->
    #1084161
    Hunter
    Moderator

    Hello 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!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘display organizers on venue page upcoming events list?’ is closed to new replies.