Understanding the Target Attribute with Links in ClickDimensions

This post was originally published on this site

Hyperlink managers in ClickDimensions give you an abundance of options to create your desired link. The hyperlink manager is designed to give the user as much freedom as possible to tailor to their organization’s needs. You can add everything from a standard link to a phone number via the simple user interface design. You can even configure how you would like for that link to open. The purpose of this blog post is to explain the many ways our hyperlink managers can open links, and if need be, where you can add some easy custom code to truly customize to your needs. Understanding a hyperlink manager’s full abilities will maximize the potential and creativity of your content.

As an end user, we seldom think about links opening. We click on the link and follow where it goes. Sometimes the link will load over the current tab we are using, and other times it will open in a new tab/window.

For example, our ClickDimensions hyperlink manager gives you the option to have links open in a new window as shown below.

What that checkbox is doing is adding some extra code into your <a> tag in the HTML.

If you choose not to check the box, the source code is set up like this:

<a href= “https://www.yourwebsitehere.com”>Click Here</a>

If you do check the box, the source code is set up like this:

<a href= “https://www.yourwebsitehere.com” target= “_blank”>Click Here</a>

The difference is target = “_blank”

The target attribute is used to specify how to display the link when clicked, and the “_blank” keyword tells it to open a new tab/window. This feature can be used natively within ClickDimensions. Links will naturally load in the frame they are in. So, specifying “_blank” will override what the browser was originally going to do, and create a new tab/window.

It’s as simple as that, but there are some things to be aware of when using this attribute. When the target attribute came about, browsers would slow down tremendously with every new tab/window opened. The more items you have open, the slower your computer will get. Naturally, users started to express their disdain. At one point, it was even removed in HTML. So, it is healthy to follow a general rule of thumb:

  • If you are linking within your website, follow: target = “_self” (which happens naturally)
  • If you are linking outside of your website, follow:  target = “_blank”

Many people wonder if “_blank” specifies a new tab or a new window, if you can specify which one. The answer is no; at least not with pure HTML. You can with JavaScript, but that requires more configuring. Modern day browser settings are set by default to open a new tab. However, a user does have the ability to go into their browser settings and change this option to open a new window instead when “_blank” is triggered.

Options for the Target Attribute

If you would like to know more about the target attribute, check out this documentation from Mozilla. Below are some of the main values you could use to edit your link.

  • “_blank” opens new tab/window
  • “_self” opens in the same frame the link is in (default)
  • “_parent” opens in the parent frame
  • “_top” opens in the full body of the window

I would suggest testing these out here.

How to Utilize This in ClickDimensions

One of the great things about ClickDimensions is its ability to take options like target attributes and make them user friendly. Shown below is the hyperlink manager used in our block editor that gives you many options for the target attribute.

We will use iframes to embed our web content, but because of the default functionality of iframes, getting links to do what is desired can often cause issues. An iframe is a wonderful and simple embedding option to easily add content on websites like ClickDimensions forms, surveys, landing pages or subscription management pages. Iframes act as an HTML document inside another HTML document, but because of iframes default functionality, this can get frustrating when trying to link outside of it. For example, a link in an iframe with no set target attribute will naturally load that link within that iframe, shown below is a very simple web page with a ClickDimensions Landing Page embedded via an iframe that I have created.

The Click Here link will default to target = “_self” and fill the iframe it is set in.

Adding target = “_blank” can get the link outside of that iframe into a new tab/window, shown below.

Or you can even use target = “_top” which will use the hierarchy of frames in your website and fill the highest space, shown below.

As you can see, the target attribute gives you many different possibilities.

Happy Marketing!

The post Understanding the Target Attribute with Links in ClickDimensions appeared first on ClickDimensions Blog.

Check Also

The Ultimate Guide to Writing LinkedIn InMails That Get Results (With Examples)

This post was originally published on this site What if you tripled your typical email …

Leave a Reply

Your email address will not be published. Required fields are marked *