Maps markers with only venue information

Home Forums Calendar Products Events Calendar PRO Maps markers with only venue information

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1165659
    Jos Miguel
    Participant

    Hi,

    I’d like to know if it’s possible for the markers in the map view to show only the venue details, not the events.

    I need this because I have several events in the same venue, and clicking the marker only shows the las event information.

    Thanks in advance.

    #1166150
    Nico
    Member

    Hola Jose, como estas?

    Me tome la libertad de contestarte en Español ya que todo indica que este es tu idioma nativo 🙂

    Lo que estas buscando es posible pegando el siguiente código en el archivo functions.php de tu tema (o de tu tema hijo -child theme-):

    /* Tribe, change map tooltips to show venue title and link instead of event title and link */
    function tribe_modify_map_ajax_markers ( $response ) {

    // bail if no markers are present in response
    if ( !isset( $response['markers'] ) || empty( $response['markers'] ) ) return $response;

    // modify markers titles

    foreach ( $response['markers'] as &$marker ) {

    $marker['title'] = get_the_title( $marker['venue_id'] );
    $marker['link'] = get_permalink( $marker['venue_id'] );

    }

    return $response;
    }

    add_filter( 'tribe_events_ajax_response', 'tribe_modify_map_ajax_markers' );

    function tribe_modify_map_label ( $data, $class, $domain ) {

    // bail if no map_tooltip_event string present
    if ( !isset( $data['map_tooltip_event'] ) ) return $data;

    // let's change the Event label to Venue
    $data['map_tooltip_event'] = __( 'Venue', 'tribe-events-calendar-pro' ) . ': ';

    return $data;
    }

    add_filter( 'tribe_events_pro_localize_script', 'tribe_modify_map_label', 10, 3);

    El script va a cambiar el titulo del tooltip y el link también. Probalo y decime si esto es lo que buscabas!

    Saludos,
    Nico

    #1166190
    Jos Miguel
    Participant

    ¡Muchas gracias, Nico!

    Funciona perfectamente 🙂

    #1166414
    Nico
    Member

    Excelente! Gracias por la confirmación Miguel 🙂

    Voy a cerrar este ticket, pero no dudes en crear uno nuevo si necesitas ayuda con algo más!

    Que tengas buena semana!

    Saludos,
    Nico

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Maps markers with only venue information’ is closed to new replies.