Home › Forums › Calendar Products › Events Calendar PRO › add venue to month tooltip
- This topic has 7 replies, 2 voices, and was last updated 11 years, 3 months ago by
Geoff.
-
AuthorPosts
-
January 6, 2015 at 9:11 am #929393
Khanh
ParticipantHi,
I want to add venue info to month tooltip.
I added the following line to month/tooltip.php in <my-theme>/tribe-events folder
<p>Venue : <?php echo tribe_get_venue_link(); ?></p>
But the venue is not getting refreshed according to the event hover.
Can you tell what am i doing wrong.
January 6, 2015 at 9:37 am #929409Geoff
MemberHi there, James! Welcome to the forums. 🙂
Good question and you’re on the right path. We’re limited in supporting custom development questions like this, but let’s see if I can at least point you in the right direction.
First off, you’ll want to put both month/tooltip.php and month/single-event.php in your theme’s tribe-events folder.
Then, in single-event.php, you’ll need to define the variable and bracket for the venue. In this case that might look something like this, starting on Line 22:
$venue = array(); $getvenue = tribe_get_venue(); $venue['venue'] = $getvenue;Then, you’ll need to call that variable in the template. To do that, head down to the bottom of the code and add the $venue variable to tribe_events_template_data():
<?php echo tribe_events_template_data( $post, $venue ); ?>With this in place, you can now add the venue to your tooltip.php template by adding [[=venue]] where you would like it to display.
Cheers!
GeoffJanuary 6, 2015 at 10:55 am #929441Khanh
ParticipantHi Geoff, Thanks for the answer.
I tried the following in single-event.php
added
$venue = array();
$getvenue = tribe_get_venue();
$venue[‘venue’] = $getvenue;
at lines 23-25added tribe_events_template_data( $post, $venue ); right before ?> line 191, removed echo as it is printing on the calendar
changed the line in tooltip.php to <p>Venue :: [[=venue]]</p>
Now the hover tooltip stopped working, tried with add/del venue line.
Thanks
Thanks
January 7, 2015 at 7:57 am #929863Geoff
MemberShoot, that’s no good! Sorry about that.
I was able to get the Venue to display using the steps I provided earlier, so you might need to check your code. Also, take a look at the notes in the month/single-event.php because they contain very detailed instructions on how to modify the tooltip–basically a more thorough explanation of the steps I provided. 🙂
Cheers!
GeoffJanuary 7, 2015 at 8:25 am #929893Khanh
ParticipantThis reply is private.
January 7, 2015 at 9:10 am #929961Geoff
MemberHey there, James! Thanks for following up and sharing your code.
Like I mentioned earlier, custom development isn’t something we’re able to provide here in the forums. That said, here’s the working example of the <i>month/single-event.php</i> used to get the Venue to display:
https://gist.github.com/geoffgraham/47a2110f77e2507ad9c6
With that, you can go into your month/tooltip.php file and simply use [[=venue]] where you want the venue to display in the tooltip.
I hope this helps and good luck!
Geoff
January 7, 2015 at 11:41 am #930035Khanh
ParticipantHi Geoff,
Thanks for the information.
I made it to work with slightly changing the code as per the following thread
It works for me. Thanks Again for your help.
Thanks
January 7, 2015 at 12:05 pm #930046Geoff
MemberAwesome, I’m stoked that helps!
I’ll go ahead and close this thread but please feel free to his us up with a new one if anything else comes up–we’d be happy to help. 🙂
Cheers!
Geoff -
AuthorPosts
- The topic ‘add venue to month tooltip’ is closed to new replies.
