How can I make the marker link to open in a new tab?

Since version 1.3.2

By default the map markers' links in the multiple entries view open in the same tab (links to the single entry view). It is possible to change the default behaviour using the hook gravityview/maps/render/options as follows:

/**
 * Tweak the map marker link target to open in a new tab (default _top)
 */ 
function my_gv_marker_link_target( $options ) {
	// possible values: _blank, _parent, _self, _top (default)
	$options['marker_link_target'] = '_blank';
	return $options;
}
add_filter( 'gravityview/maps/render/options', 'my_gv_marker_link_target', 10, 1 );

The map option key marker_link_target specifies the target attribute for the marker link. 

The following values are supported: 

  • _blank - URL is loaded into a new window. 
  • _parent - URL is loaded into the parent frame 
  • _self - URL replaces the current page 
  • _top - URL replaces any framesets that may be loaded (This is default)