Home › Forums › MapPress Support › Links in map open a new window
- This topic has 6 replies, 2 voices, and was last updated 5 months ago by
Chris.
-
AuthorPosts
-
May 20, 2019 at 4:00 am #18327
I have a mashup with several points of interest. When you click on the any red droplet, it opens up a small window with the name of the point of interest. But when you click on the name of the poi, it opens the page in a new window. Can I change the behavior of this? I want the link to go to the new page but not open a new window. An example is at: https://www.grandcanyondeals.com/page-az-hotels/
May 20, 2019 at 4:01 am #18328Hi,
Have a look at the MapPress settings screen in the ‘POI Click’ section, I think ‘Open post’ may be what you want.
September 25, 2019 at 9:31 am #18403Thank. That looks like the right setting to change but it does not help.
There are three options for POI Click.
I originally had it on “Open POI”. When I clicked on a dot, it would show a little balloon with the name of the poi. When clicking on poi, it would open the post in a new tab.
The other two options were “Open Post” and “Post in new Tab” No matter which one I use, it opens the post in a new tab.
Am I doing something wrong?
September 25, 2019 at 9:39 am #18404Hi,
Sorry for the confusion, I think I misunderstood your original question. This should help:
To control what happens when a marker is clicked: use the settings ‘open POI’, ‘open post’, and ‘open post in new tab’. One of these options (‘open post’) wasn’t working properly – I had planned to deprecate it, but left it on the settings screen. This is fixed in 2.53.3.
To control what happens when the POI title is clicked (I think this is what you want to do): use the ‘templates’ section in the MapPress settings to edit the ‘mashup popup’ template. In that template you’ll see:
<div class='mapp-title'><a href='{{{poi.url}}}' target='_blank'>{{{poi.title}}}</a>Just change it to this (remove the target=’_blank’) and save:
<div class='mapp-title'><a href='{{{poi.url}}}'>{{{poi.title}}}</a>March 12, 2026 at 8:32 pm #22004Hi,
I’m having this same problem, but in the current version of MapPress pro, there doesn’t seem to be a “templates” section. How would I change the post title links on the POI popup from target=”_blank”, so that the links don’t open in a new tab?
I’m also having trouble with the images looking like links, but not linking to the post; is there a way for the thumbnails to link to the post too?
https://www.vernaculartypeproject.com/map/
Thanks~
Elisabeth
March 12, 2026 at 8:36 pm #22011Hi,
There is a template section in MapPress Pro, it should be on the plugin settings page just after the ‘filters’ section.
Since you are using a mashup, you can just use the settings in the ‘Mashups’ section to control how the POIs open (in a popup, a new tab, or the same tab), without having to edit any templates.
March 14, 2026 at 1:10 pm #22012Thanks! I was able to edit the template to get the title within the mashup popup to open in the same window; but I can’t figure out how to link the image (featured image) in the mashup popup to the post as well. Can you help?
March 14, 2026 at 1:11 pm #22014Hi,
If you use the mashup settings to control how the POIs open (without changing the template), it should apply the same behavior to both the POI title and the featured image.
March 15, 2026 at 1:03 pm #22015So, when I use the unedited original template, the thumbnail featured image doesn’t link to anything, and the title links to the post in a new image. Attached are my mashup settings; I want the poi to open in a popup, and then from the popup open in the same window (not a new window), for both the title and the thumbnail. There doesn’t seem to be an option for this. See image of settings below.
For the marker click, I want to “open popup,” but as I mentioned, if I choose that opens then the default is to open everything in a new tab.
For the popup content that’s working fine; but the thumbnail isn’t mentioned there, it seems to be automatically added elsewhere, and there aren’t any settings for how the thumbnail should behave in the popup. What am I missing?
March 15, 2026 at 2:32 pm #22016Hi,
Thanks, I see what you want now. Unfortunately, this functionality (of opening a new tab on image click) is hardcoded in the plugin. I do plan to revisit those settings in a future release, but for now I’m afraid that’s the functionality.
If you’re familiar with PHP, you could try this:
1. In the ‘thumbnails’ setting, select ‘POI images’ – to turn off the featured images
2. In your theme’s functions.php add a little code to feed the featured image URL to the mashup POI template
add_filter('mappress_poi_props', function($props, $oid, $poi, $otype) { $props['zzurl'] = get_the_post_thumbnail_url($oid, 'full'); return $props; }, 10, 4);3. In the mashup popup template, use the URL to add an anchor link to the post:
<div class="mapp-title"><a href="{{{poi.url}}}" target="_blank" rel="noopener">{{{poi.title}}}</a></div> <a href="{{{poi.url}}}"><img src="{{{poi.props.zzurl}}}" /></a> <div class="mapp-body">{{{poi.body}}}</div> -
AuthorPosts
- You must be logged in to reply to this topic.
