New pro 'tribe events’ short code & Schema markup

Home Forums Ticket Products Event Tickets Plus New pro 'tribe events’ short code & Schema markup

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1344870
    Yuki
    Participant

    Hello,

    We have discovered the new pro ‘tribe events’ short code, which enables us to create more SEO friendly ‘URL’ negating the need for the category pages – however we are having a problem with schema displaying.

    We added the fix for displaying schema on list view as documented in a previous post, it works like a charm on both category list view and with the old short code – ‘tribe_events_list’ (when we needed to display on ‘standard pages’)

    However with the new short code, we no longer see any events when we do a structured data test? Is there something we are missing and or do we need to modify below, to reference the new ‘tribe_events view’

    /* Tribe, add structured data to list view */
    function tribe_list_view_structured_data ( ) {

    // bail if not list view
    if ( !tribe_is_list_view() ) return;

    global $wp_query;

    Tribe__Events__JSON_LD__Event::instance()->markup( $wp_query->posts );
    }
    add_action( ‘wp_head’, ‘tribe_list_view_structured_data’);

    Sorry we are quite new to this plugin – any advice would be greatly appreciated.

    Thanks,

    #1345671
    Andras
    Keymaster

    Hello Yuki,

    Thanks for reaching out!

    Not quite sure what the issue could be, so let’s start digging.

    What is the exact shortcode you are using?

    Can you share with me a URL to a page with a shortcode and also to the normal list view of events?

    Also you can try commenting out this line in the code to see if that changes anything. Note, this is for testing only. The shortcode might not use the list view.

    if ( !tribe_is_list_view() ) return;

    Let me know the results.

    Cheers,
    Andras

    #1346489
    Yuki
    Participant

    Hi András – thanks for getting back to us 🙂

    Let me try answer some of your questions – again, we are very new to this, so apologies if we’re not making sense!

    When we started our project, we were using the default listing set to List View to display our events, and, together with the function we found on your forum (‘tribe_list_view_structured_data’ from https://theeventscalendar.com/support/forums/topic/schema-on-event-list-pages/), we were able to see the generated schema data beautifully both on the default event page, and also if we used the [tribe_events_list] shortcode to generate and Upcoming Events widget.

    However, due to SEO considerations, we have moved away from using the default Events page for listing our events, as we found the [tribe_events] shorcode which we could use to embed the full list into our own custom templates. However, with this new shortcode, even with view=‘list” set , it doesn’t seem to generate event schema data like the default listing or original (tribe_events_list) shortcode.

    As such, we were wondering if we could update the schema function so that the tribe_events shortcode would generate schema data like the other options?

    Quick breakdown:

    —————————————————————————–

    with ‘tribe_list_view_structured_data’ function active

    – default event list (list view) – shows schema

    #1346491
    Yuki
    Participant

    It seems my reply was cut short! Here is the last piece again!

    Quick breakdown:

    with ‘tribe_list_view_structured_data’ function active
    – default event list (list view) – shows schema

    #1346492
    Yuki
    Participant

    It doesn’t seem to like my formatting – let me try again!

    Quick breakdown:

    with ‘tribe_list_view_structured_data’ function active:
    default event list (list view) – shows schema
    [tribe_events_list] shortcode – shows schema
    [tribe_events view=‘list’] – no schema

    with ‘tribe_list_view_structured_data’ function inactive:
    no schema shown for any

    I hope this makes sense!?

    Thank you again for your help 🙂

    Kindest regards

    #1347445
    Andras
    Keymaster

    Hi Yuki,

    Totally makes sense, thanks for the detailed explanation.

    I’ll check around if someone has an idea about this, and I’ll get back to you as soon as I have something. Please hang in there.

    Cheers,
    Andras

    #1347570
    Andras
    Keymaster

    Hello Yuki,

    A colleague was kind enough to check this.

    Try removing the snippets you used before (or comment them out / disable them) and try this one if it helps:

    function tribe_events_shortcode_json_ld_output() {
    Tribe__Events__JSON_LD__Event::instance()->markup( $GLOBALS['wp_query']->posts );
    }
    function tribe_events_shortcode_json_ld_trigger() {
    add_action( 'tribe_events_pro_tribe_events_shortcode_output', 'tribe_events_shortcode_json_ld_output' );
    }
    add_action( 'tribe_events_pro_tribe_events_shortcode_prepare', 'tribe_events_shortcode_json_ld_trigger' );

    Cheers,
    Andras

    #1358373
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘New pro 'tribe events’ short code & Schema markup’ is closed to new replies.