Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 01-29-2022 06:52:34

Graham
Member
Registered: 09-30-2004
Posts: 981
Website

Adding "Link Opens in New Window" symbol after "target = _blank"

Often I want links from my pages to open in a new window so a customer isn't taken away from the page they're on, but, previously I've had to add "Opens in new window" in the text which clutters things up and is a bit clunky, for example I put:

Code:

<a href= [link] target="_blank">See this page (Opens in new window)</a>

I've found the following bit of css which you can add to System/ Displays/ Display Skins all.min.css and which will put the "Opens in New Window" symbol (a square box with an arrow pointing out of it) on any link that has target = "_blank" after it

Code:

a[target="_blank"]::after {

  content: 

url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==);
  margin: 0 3px 0 5px;

}

Simple, neat and tidies up the page a bit :-)

Offline

 

#2 01-29-2022 13:52:06

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19782
Website

Re: Adding "Link Opens in New Window" symbol after "target = _blank"

Thanks for posting.  The software uses rel="external" for all links that target _blank which allows the HTML to remain valid output.  I'd recommend using rel="external" on your links, and then adjusting the CSS to make use of that.


Nick Hendler

Offline

 

#3 01-29-2022 14:46:32

Graham
Member
Registered: 09-30-2004
Posts: 981
Website

Re: Adding "Link Opens in New Window" symbol after "target = _blank"

I presume you mean the HTML link would read:

Code:

<a href= [link] rel="external">See this page </a>

That seems to work.

Offline

 

#4 01-31-2022 09:10:03

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19782
Website

Re: Adding "Link Opens in New Window" symbol after "target = _blank"

Graham wrote:

I presume you mean the HTML link would read:

Code:

<a href= [link] rel="external">See this page </a>

That seems to work.

Correct.  rel="external" would replace target="_blank".


Nick Hendler

Offline

 

Board footer