basic customization in order to display venue and/or city in list view

Home Forums Calendar Products Events Calendar PRO basic customization in order to display venue and/or city in list view

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1333347
    Felix
    Participant

    Dear Customer Support,

    on my dev site I am preparing to customize the standard list view by overriding the template single-event.php (list):

    Now it shows the following information:
    <!– Schedule & Recurrence Details –>
    <!– Event Title –>
    (modified with a link to the organizer:
    <?php echo( tribe_get_organizer_link() ); ?>

    Below that information and above the <!– Event Image –>
    I would like to display information about the venue and/or city

    It is existing information that is displayed in the single event view.

    How can I refer to it in the single-event.php (list) file and display it?

    Any help from your team is highly appreciated.

    I am looking forward to hear back from you.

    Felix

    • This topic was modified 6 years, 8 months ago by Felix. Reason: correction of mis-formatting
    #1333349
    Felix
    Participant

    This reply is private.

    • This reply was modified 6 years, 8 months ago by Felix.
    #1333679
    Shelby
    Participant

    Hey Felix,

    Looks like you’re making some pretty cool customizations! I’d recommend trying the following code where you wanted to insert the venue details.  As always, back up your files before modifying, just in case! 🙂

    <?php echo( tribe_get_venue_details() ); ?>

    Please let me know how it goes!

    Best,

    Shelby 🙂

    #1333724
    Felix
    Participant

    This reply is private.

    • This reply was modified 6 years, 8 months ago by Felix. Reason: it did not display properly
    #1334257
    Felix
    Participant

    Hi Shelby,

    all my apologies for my non-existing php knowledge…

    Thank you for your prompt reply, your positive feedback and your suggestion.

    I tried to add the code snippet that you suggested.

    See as well line 63/64:
    <?php echo( tribe_get_venue_details() ); ?>

    It shows as:
    http://garage.freieszene.de/events/

    Since in line 17 $venue_details are defined as an array
    –> $venue_details = array();
    Simply the word “array” is displayed.

    Do you know how I could achieve to simply display the actual venue details and NOT the word “array”?

    I am looking forward to your answer.

    Best regards,

    Felix

    full single-event.php (list) file:

    <?php 
    /**
     * List View Single Event
     * This file contains one event in the list view
     *
     * Override this template in your own theme by creating a file at [your-theme]/tribe-events/list/single-event.php
     *
     * @package TribeEventsCalendar
     *
     */
     
    if ( !defined('ABSPATH') ) { die('-1'); } ?>
     
    <?php 
     
    // Setup an array of venue details for use later in the template
    $venue_details = array();
     
    if ($venue_name = tribe_get_meta( 'tribe_event_venue_name' ) ) {
        $venue_details[] = $venue_name;    
    }
     
    if ($venue_address = tribe_get_meta( 'tribe_event_venue_address' ) ) {
        $venue_details[] = $venue_address;    
    }
    // Venue microformats
    $has_venue_address = ( $venue_address ) ? ' location': '';
     
    // Website
    $website = tribe_get_event_website_link();
     
    ?>
     
    <!-- Event Cost -->
    <?php if ( tribe_get_cost() ) : ?> 
        <div class="tribe-events-event-cost">
            <span><?php echo tribe_get_cost( null, true ); ?></span>
        </div>
    <?php endif; ?>
     
    <!-- Schedule & Recurrence Details -->
        <h2 class="updated published time-details">
            <?php echo tribe_events_event_schedule_details() ?>
        </h2>
     
    <!-- Event Title -->
    <?php do_action( 'tribe_events_before_the_event_title' ) ?>
    <h2 class="tribe-events-list-event-title entry-title summary">
        <a class="url" href="<?php echo tribe_get_event_link() ?>" title="<?php the_title() ?>" rel="bookmark">
            <?php the_title() ?>
        </a>
    </h2><br>
     
    <h3><?php echo( tribe_get_organizer_link() ); ?>
    </h3>
     
    <h3><?php echo( tribe_get_venue_details() ); ?>
    </h3>
     
    <?php do_action( 'tribe_events_after_the_event_title' ) ?>
     
    <!-- Event Meta -->
    <?php do_action( 'tribe_events_before_the_meta' ) ?>
    <div class="tribe-events-event-meta vcard"> <div class="author <?php echo $has_venue_address; ?>">
     
        <?php if ( $venue_details ) : ?>
            <!-- Venue Display Info -->
            <div class="tribe-events-venue-details">
                <h3><?php echo implode( ', ', $venue_details) ; ?></h3>
            </div> <!-- .tribe-events-venue-details -->
        <?php endif; ?>
     
    </div> </div><!-- .tribe-events-event-meta -->
    <?php do_action( 'tribe_events_after_the_meta' ) ?>
     
    <!-- Event Image -->
    <?php echo tribe_event_featured_image( null, 'medium' ) ?>
     
    <!-- Event Content -->
    <?php do_action( 'tribe_events_before_the_content' ) ?>
    <div class="tribe-events-list-event-description tribe-events-content description entry-summary">
        <h2><?php the_excerpt() ?></h2>
            <h2>
        <a href="<?php echo tribe_get_event_link() ?>" class="tribe-events-read-more" rel="bookmark"><?php _e( 'Mehr...', 'tribe-events-calendar' ) ?> &raquo;</a>
            </h2>
    </div><!-- .tribe-events-list-event-description -->
    <?php do_action( 'tribe_events_after_the_content' ) ?>
    #1335263
    Shelby
    Participant

    Hey there Felix,

    You’ll need to pass variables through your array in order to print the information related to the variables. 🙂 If you don’t have much PHP knowledge, I’d suggest hiring a freelancer. We have a list of suggestions for finding a freelancer and a list of potential freelancers here.

    Unfortunately, we don’t support PHP customizations like this one on these forums. These forums are intended to troubleshoot issues and field bug reports with our plugins as configured with the latest version of WordPress, WordPress default themes, and our suite of plugins with their out of the box features.

    Please let me know if there’s anything along those lines that I can help you with!

    Best,

    Shelby 🙂

    #1344948
    Support Droid
    Keymaster

    Hey 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘basic customization in order to display venue and/or city in list view’ is closed to new replies.