Home › Forums › Calendar Products › Events Calendar PRO › Why doesn't the Calendar view's tooltips show the event location?
- This topic has 5 replies, 2 voices, and was last updated 8 years, 11 months ago by Geoff.
-
AuthorPosts
-
May 27, 2015 at 9:30 pm #965561DanielleParticipant
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.
May 28, 2015 at 7:40 am #965645GeoffMemberHi 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!
GeoffMay 28, 2015 at 7:14 pm #965925DanielleParticipantThanks 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]]
May 29, 2015 at 8:41 am #966012GeoffMemberHi 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
May 29, 2015 at 10:15 am #966038DanielleParticipantThat worked great thanks. I hope someone else finds this helpful too.
May 29, 2015 at 10:50 am #966044GeoffMemberAwesome! Thanks for following up and letting me know this worked–I’m sure others will certainly find it useful. 🙂
Cheers!
Geoff -
AuthorPosts
- The topic ‘Why doesn't the Calendar view's tooltips show the event location?’ is closed to new replies.