• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Fixed Location in user blurb should open in new tab

Affected version


Active member
What template is the location link at? I want to make it open in a new tab rather than redirect the current page to google maps.


Active member
just search the templates for "misc/location-info".

Here is one place: member_about

                    <xf:if is="$user.Profile.location">
                        <dl class="pairs pairs--columns pairs--fixedSmall">
                            <dt>{{ phrase('location') }}</dt>
                                <a href="{{ link('misc/location-info', '', {'location': $user.Profile.location}) }}" rel="nofollow" target="_blank" class="u-concealed">{$user.Profile.location}</a>
as you can see it already opens in a target="_blank"..


Active member
Yeah I have done exactly what you have said and noticed that it should already open in a new window however it doesn't. It is also the same here on Xenforo, it does not open in new window.

If you click on a member, then click their location, it redirects them on same page.


Active member
Right, did not notice this till now. There is no target="_blank" in the final source code.

This seems to cause this:

        if ($user->Profile->location)
            $location = \XF::escapeString($user->Profile->location);
            $location = '<a href="' . $this->app->router('public')->buildLink('misc/location-info', null, ['location' => $location]) . '" class="u-concealed">' . $location. '</a>';
            $blurbParts[] = \XF::phrase('from_x_location', ['location' => new \XF\PreEscaped($location)])->render();
Method: \XF\Template\Templater->fnUserBlurb()


Active member
I have reported this thread - let's wait for the staff to answer if this behavior is intended.

If it is important to you, you can try to hack core. Change this line:
            $location = '<a href="' . $this->app->router('public')->buildLink('misc/location-info', null, ['location' => $location]) . '" class="u-concealed">' . $location. '</a>';
            $location = '<a href="' . $this->app->router('public')->buildLink('misc/location-info', null, ['location' => $location]) . '" class="u-concealed" target="_blank">' . $location. '</a>';
This will make the link open in a new window.

File: /src/XF/Template/Templater.php