When configuring a web map popup, the interface allows access to the HTML tags. When creating a link from the popup, the default href target is "_blank"; changing the target to "_self" (or any other valid target) is ignored by ArcGIS Online--the resulting web map popup only supports "_blank".
It would be great if changes made to the target attribute are respected by ArcGIS Online.
I fully support this idea.
We configured a map in Map Viewer with a a popup which includes a hyperlink. If I look at the source of the popup, the system has automatically added the attributes: target="_blank" rel="noopener noreferrer".
Now, for accessibility reasons it's better to have links open in the same window, so I changed target="_blank" to target="_self". But when I do this, the target of the hyperlink specified by the href attribute is stripped from the popups source automatically and leaves the link as: <a target="_self">, which goes nowhere as there is no href attribute.
If I remove the target="_blank" attribute, it just comes back, it's not possible to remove it.
To me this is a bug as changing the target from "_blank" to "_self" deletes the href.
There is a post by @rdbutger where he shows he used Arcade in the web map popup to bypass this automatic behavior.
Here is my sample code:
This allows me to change the page in-place, instead of opening a new tab.
var baseurl = 'https://www.something.com/route/'
var code = Lower($feature.ColumnName)
var train_stations_public_page = Concatenate([baseurl,code])
Console(train_stations_public_page)
var train_stations_public_page_link = '<strong><a style="color:#01507b;text-decoration: underline;cursor:pointer" target="_self" href="' + train_stations_public_page + '">Station Details</a></strong>'
Console(train_stations_public_page_link)
return {
type : 'text',
text : train_stations_public_page_link
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.