• Resolved kpwawp

    (@kpwawp)


    Hello,

    we are using the calendar two times in one page. On the top of the page and at the end of the page (near footer). It′s embedded by Elementor. The legend is displayed in the first, upper calendar; it is not displayed in the 2nd, lower calendar. In the developer tools it is also not to be found in the 2nd calendar either in the code.
    Can you please tell us how we can show the legend on both if there are 2 calendars on one page?

    Thanks and regards

Viewing 13 replies - 16 through 28 (of 28 total)
  • Thread Starter kpwawp

    (@kpwawp)

    The code causes following fatal error, whether it is included in functions.php or in a file in the mu-plugins folder.

    PHP Fatal error: Uncaught Error: Call to undefined method Tribe\Events\Event_Status\Template::get_view() in /wp-content/mu-plugins/tribetest.php:19

    In line 19 is this line:
    if ( method_exists( $template->get_view(), ‘get_view_slug’ ) ) {

    Plugin Author Andy Fragen

    (@afragen)

    Not sure what to tell you. That code comes from the Category Colors plugin. It shouldn’t run unless TEC is active and I tested it before sending it to you.

    Thread Starter kpwawp

    (@kpwawp)

    Ok, am I right, that this code is only to test/show that the hook fires but it only gives one response per page? Not for solving the problem?

    Plugin Author Andy Fragen

    (@afragen)

    Correct. It shows that only the first view available on the page shows and that’s why the legend doesn’t display on the second view.

    Thread Starter kpwawp

    (@kpwawp)

    Can you please tell me in which files in the plugin I can find the code for the hook?

    Thread Starter kpwawp

    (@kpwawp)

    Correct. It shows that only the first view available on the page shows and that’s why the legend doesn’t display on the second view.
    Ok, but what is causing that, that the legend doesn′t display on the second view?

    The TEC Support sent me following filter, which shows, that the view slug being used per calendar/shortcode. You can see it on this screenshot.

    add_filter ( ‘tribe_template_before_include:events/v2/components/before’, function ($file, $name, $template) {
    $current_view = $template->get_view();
    echo ‘I came from template before include filter!‘ . ‘ / ‘ . $current_view->get_view_slug();
    return;
    }, 3, 10);

    With wich filter / code is the legend embedded?

    Plugin Author Andy Fragen

    (@afragen)

    I had no idea the hook could be extended I like that. Let me experiment.

    Plugin Author Andy Fragen

    (@afragen)

    I think I’ve gotten this working on my end. You can test with the develop branch. LMK if it works for you and I’ll submit a release.

    Thread Starter kpwawp

    (@kpwawp)

    I′ve tested it in my staging, with Elementor and also with Block Editor and WordPress Default Theme, I′m sorry but it doesn′t work :/
    Did you also changed something at the method to embedding the calendar or at the calendar settings in WordPress Backend?

    Plugin Author Andy Fragen

    (@afragen)

    Hmm, I see it in my site when I’m logged in but not when I’m logged out. No idea at the moment.

    Plugin Author Andy Fragen

    (@afragen)

    I think I found the issue. Can you test the develop branch via the link above — again?

    Thread Starter kpwawp

    (@kpwawp)

    Yes, it works :)))
    Thanks a lot for solving the issue!

    Plugin Author Andy Fragen

    (@afragen)

    Awesome! I should have a new version out today or tomorrow.

Viewing 13 replies - 16 through 28 (of 28 total)
  • The topic ‘Missing Legend on second calendar on one/same page’ is closed to new replies.