× Forum for the GPXTrackMap Content Plugin for Joomla! 2.5 and 3.x

Link in waypoint

fingeradmin replied the topic: Link in waypoint

1 month 4 weeks ago


there are two ways to include links in waypoint descriptions:
one via the [url... BBCode and one via the [link... tag that e.g. Basecamp uses.

The BBCode is done in this block of code:

$bbcode = array(
            "/\[br\]/is" => "<br />",
            "/\[b\](.*?)\[\/b\]/is" => "<strong>$1</strong>",
            "/\[u\](.*?)\[\/u\]/is" => "<u>$1</u>",
            "/\[i\](.*?)\[\/i\]/is" => "<i>$1</i>",
            "/\[code\](.*?)\[\/code\]/is" => "<pre>$1</pre>",
            "/\[quote\](.*?)\[\/quote\]/is" => "<blockquote>$1</blockquote>",
            "/\[url\=(.*?)\](.*?)\[\/url\]/is" => "<a href='$1' target='_self'>$2</a>",
            "/\[img\](.*?)\[\/img\]/is" => "<img src='$1' alt='' />"

The [link... stuff is handled a few lines down:
          if ($this->_params['wppopupdescbb'] == 1) {
            $bbcode = array(
              "/\[link".$linkno."\](.*?)\[\/link".$linkno."\]/is" => "<a href='".$wpthref."' target='_blank'>$1</a>");

If you change both places to target='_self' it should work the way you want.

I'm using the BBCode version in my project about panorama pictures from Morocco here on my main site: pano maroc
The popups on the maps all have links on the images, and they all go to the same browser tab.

hth & cheers, Frank

Last Edit: 1 month 4 weeks ago by fingeradmin.

Please Log in or Create an account to join the conversation.

hikeguy55 created the topic: Link in waypoint

2 months 14 hours ago

Hello Frank,
I've read and tested the forum topic "Link auf waypoint", but I can't get it to work the way I want.
Scrapping target=_blanc in line 1097 in the gpxtrackmaps.php file, or replacing it with target=_self doesn't work.The link in the popup always opens in a new window.
When I look at the code with the developer tools of my browser, I notice that the link still has the target=_blanc attribute, although I changed it in the gpxtrackmaps.php file.
When i change _blanc to _self in the developer tool, then the link opens in the same window.
Any idea why it won't work?

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum