Help Desk

Add Orgaziner to calendar detail overlay (Part II)

  • Posts: 202 Topics: 72
    | Permalink

    In relation to this: https://tri.be/support/forums/topic/add-orgaziner-to-calendar-detail-overlay/ – this doesn’t work anyhow:

    <?php echo tribe_get_organizer($event->ID); ?>.

    It only returns the first created Organizer (on the Organizer list) and not the actual different Orgaziners for each event.

    Posts: 3519 Answers: 115
    | Permalink

    mending,
    Thanks for getting in touch. As this is related to a customization, we unfortunately won’t be able to provide further support on this. Feel free to look at our developer docs to understand further how this function works.

    Thanks! 🙂

    -Casey-

    Posts: 202 Topics: 72
    | Permalink

    But if you cannot provide a single line of code that works (though you developed it) how should then we be able to look this up?

    Posts: 4278 Topics: 105 Answers: 467
    | Permalink

    Hey Lars! It looks like Casey attempted to point you in the general direction for you to display the organizer name in the tooltips, but you haven’t yet tested these suggestions? Or are we misunderstanding and your question is that you can’t find out how to do this via the dev docs resource Casey linked to.

    Sounds like this is ultimately a customization, after chatting with Casey – are you saying that the answer provided here (https://tri.be/support/forums/topic/add-orgaziner-to-calendar-detail-overlay/#post-123480) didn’t help point you in the right direction? What about that code is giving you problems?

    Posts: 202 Topics: 72
    | Permalink

    Hi Rob! We did of course test it – placing this <?php echo tribe_get_organizer($event->ID); ?> in the right spot in the tooltip.php file. But as described the code is not showing the right Organizer for each event. Something is wrong ($event->ID).

    Posts: 3519 Answers: 115
    | Permalink

    Lars,
    You’ll definitely want to make sure that you’ve updated your tooltips template files since upgrading to vesion 3.5, as we’ve made a lot of changes with how the tooltip templating functions. That might help to address your issue. Thanks! 🙂

    -Casey-

    Posts: 202 Topics: 72
    | Permalink

    Of course we updated to version 3.5 as well as the tooltip.php file itself. But nonetheless – it doesn’t work. As described: your line of code: <?php echo tribe_get_organizer($event->ID); ?> will pick and show the same Organizer for all our events in the Tooltip – and not the right Organizer (as they are different from one another) by it’s related Event ID.

    If Modern Tribe doesn’t know how get this information out by it’s right ID – we can’t see how we should be able to do it ourselves by referring to your resources and guides?

    Posts: 3519 Answers: 115
    | Permalink

    Lars,
    It looks like the Event ID is getting passed using a different variable name in the new tooltips.php file, so this code should work for you:

    <?php echo tribe_get_organizer($event_id); ?>
    

    Give that a shot and let me know if it does the trick. Thanks! 🙂

    -Casey-

    Posts: 202 Topics: 72
    | Permalink

    Same result. It just shows the same Organizer (the one with the highest ID number) for all events.

    Posts: 3519 Answers: 115
    | Permalink

    Ok, I’m still getting my feet wet on the new tooltip templating system, so thanks for bearing with me. If you look in views/month/single-event.php, you’ll see a very thorough write-up on how the new JavaScript templating system works, along with the ability to add your own variables for use within tooltip.php using the tribe_events_template_data() function.

    Go ahead and override the template and replace the code at the bottom of views/month/single-event.php (starting at line 191) with the following code:

    Then you’ll need to update your tooltip template to display this organizer variable that we’ve made available. You can do that using the following code:

    [[ if(organizer.length) { ]]
      Organizer: [[=organizer]]	
    [[ } ]]
    

    That should finally get you where you need to be with this. Give that a shot and let me know if you have further questions. Thanks! 🙂

    -Casey-

    Posts: 202 Topics: 72
    | Permalink

    Thanks, but it didn’t work either. It causes the Tooltip box to not show at all. Did you test this yourselves? Guess we just have to leave this as it seems just a difficult for you – as it is for all of us – to work with your calender.

    Posts: 3519 Answers: 115
    | Permalink

    Lars,
    Yes, I tested this successfully in my own environment. Different organizers were displaying for me with no issues. Did you make the modifications to single-event.php?

    Posts: 202 Topics: 72
    | Permalink

    Oh… I’m working with Week View. Not Month View… so that’s why! Is that possible as well?

    Posts: 3519 Answers: 115
    | Permalink

    That would explain it. 😉 Yes, this is possible, you’ll just want to modify views/pro/week/single-event-hourly.php to use some of the code that I shared for the single-event.php file, and then update views/pro/week/tooltip.php using the code I shared above.

    Keep in mind that you might have to modify some of the code in order for this to work in week view. For example you’ll need to change some of the variable names ($event_id to $event->ID) in order for the Organizer to be retrieved successfully.

    You should be able to take my month view example and modify it for Week View fairly easily. Good luck! 🙂

    -Casey-

    Posts: 202 Topics: 72
    | Permalink

    Did you get this to work with Week View? If so please advice. Thanks a lot.

    Posts: 3519 Answers: 115
    | Permalink

    Lars,
    The process should be similar, but unfortunately since I was able to provide a proof of concept with code for Month view, I cannot justify spending more time to also provide a customization for week view for you. My month view example should be easily adapted to use for week view. Good luck!

    -Casey-