June 18, 2015

Sitecore 8 Bug: Link Sets Anchor Target to Active Browser

By: Craig Taylor
June 18, 2015

Links be broke
We recently ran into an issue while trying to render links set in Sitecore 8 (Update 3, to be specific).  When using the "General Link" field to insert a link, we discovered that the "target" options for the link were incorrect.  The options provided out of the box were "Active Browser", "Custom" and "New Browser":

Original Link Target Options


One would assume that "Active Browser" would set the target of the anchor tag to "_self" or "_top" so that it opens in the same window.  Unfortunately, what happens is that Sitecore literally puts "Active Browser" in the target attribute, which is not valid and ends up actually opening a new window/tab.

Workaround/Fix

I opened a support ticket with Sitecore and they acknowledged this as a bug and it should be fixed in a future release.

In the meantime, you can adjust the settings of the "Link Details" box to display new target options as follows:

  1. In the "Core" database, navigate to the "/sitecore/client/Applications/Dialogs/InsertLinkViaTreeDialog/PageSettings/TargetsSearchPanelConfig" item.
  2. In the "Root" field of the "Filters" section, specify the "sitecore/client/Business Component Library/System/Texts/Targets" item. (default is "sitecore/client/Applications/Dialogs/InsertLinkViaTreeDialog/PageSettings/Targets")
Now, when you insert a link, you see target options that will work when rendered in the browser: "_blank", "_parent" and "_top":

Updated Link Target Options
Note: If you already had links set to "Active Browser", leaving the default of "SelectTarget" will still render the target as "Active Browser."  You need to open the "Insert Link" option, select "Insert" and then save the item for it to use the proper value.

2 comments:

  1. Thank you for posting this bug. I've also encountered this bug.

    ReplyDelete
  2. Thank you, thank you, thank you!
    This bug was so annoying, I am so glad there is an actual fix!!
    Going to try it right now :)

    ReplyDelete