Why doesn't the Calendar view's tooltips show the event location?

Home Forums Calendar Products Events Calendar PRO Why doesn't the Calendar view's tooltips show the event location?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #965561
    Danielle
    Participant

    It seems the event location is one of the most important elements of an event but it’s been left out of the Calendar view’s tooltip. On top of that, it’s extremely confusing on how to add the new properties (City, State in my case). There’s a random 150 lines of commented code document that try to explain the Javascript Templating System.

    #965645
    Geoff
    Member

    Hi Danielle,

    Thanks for reaching out and sorry for the trouble here. I know working with the tooltips can be tricky and tough to maneuver.

    You can certainly add the venue to the tooltip. This answer in this thread provides the steps to do that, including a code example. Give that a go and see if it will help you out as well. 🙂

    Cheers!
    Geoff

    #965925
    Danielle
    Participant

    Thanks but that only helps me display a single item. I’m trying to display both city and state. Adding just one works fine but adding both causes the code below to throw an error saying state is not defined.

    Uncaught TemplateError: ReferenceError: state is not defined (on tribe_tmpl_tooltip line 11)
    (anonymous function) @ tribe_tmpl_tooltip:23
    (anonymous function) @ tribe-events.min.js:1a @ tribe-events.min.js:1
    (anonymous function) @ tribe-events.min.js:1m.each.m.event.special.
    (anonymous function).handle @ jquery.js:3m.event.dispatch @ jquery.js:3m.event.add.r.handle @ jquery.js:3

    /month/single-event.php

    
    <?php
    global $post;
    $day            = tribe_events_get_current_month_day();
    $event_id       = "{$post->ID}-{$day['daynum']}";
    $start          = tribe_get_start_date( $post, false, 'U' );
    $end            = tribe_get_end_date( $post, false, 'U' );
    $city           = array();
    $getcity        = tribe_get_city();
    $city['city']   = $getcity;
    $state          = array();
    $getstate       = tribe_get_state();
    $state['state'] = $getstate;
    ?>
    
    <div id="tribe-events-event-<?php echo $event_id ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo tribe_events_template_data( $post, $city, $state ); ?>'>
    	<h3 class="tribe-events-month-event-title entry-title summary"><a href="<?php tribe_event_link( $post ); ?>" class="url"><?php the_title() ?></a></h3>
    </div><!-- #tribe-events-event-# -->
    

    /month/tooltip.php

    [[=city]] [[=state]]

    #966012
    Geoff
    Member

    Hi Danielle,

    Thanks for following up! It looks like the sticking point there is using two arrays where one can be used to grab both City and State.

    Try removing that code and using this in your month/single-event.php file instead:

    `<div id="tribe-events-event-<?php echo $event_id ?>" class="<?php tribe_events_event_classes() ?>" data-tribejson='<?php echo tribe_events_template_data( $post, array( 'state' => tribe_get_state(), 'city' => tribe_get_city() ) ); ?>'>`

    Then, you should be able to use the city and state brackets in month/tooltip.php as you would expect:

    [[=city]] [[=state]]

    Let me know if that helps out. 🙂

    Geoff

     

    #966038
    Danielle
    Participant

    That worked great thanks. I hope someone else finds this helpful too.

    #966044
    Geoff
    Member

    Awesome! Thanks for following up and letting me know this worked–I’m sure others will certainly find it useful. 🙂

    Cheers!
    Geoff

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Why doesn't the Calendar view's tooltips show the event location?’ is closed to new replies.