cancel
Showing results for 
Search instead for 
Did you mean: 
kbeimfohr
Community Advocate
Community Advocate

Making a hyperlink open in a new tab/window

Jump to solution

There are many times I would like to create a hyperlink that will take students to an external website.  I would like to be able to have the new webpage open in a new window or tab.  Is there a way to do that in the Rich Content Editor?

1 Solution

Accepted Solutions
Robbie_Grant
Community Coach
Community Coach

kbeimfohr​,

I am going to link to the original for credit, but yes, this can be done:

Open links in new tab

From stefaniesanders​,

to "force" a hyperlink to open in a new window or tab, the HTML of the page needs to be edited to insert a "new page" attribute. When editing the content page, click on the HTML Editor link at the upper right to switch to the HTML view for the page, then insert the target="_blank"attribute immediately after the quotation marks that end the URL. The code for a link to a picture of Toompea Castle on Wikimedia Commons looks like this:

<p><a href="https://upload.wikimedia.org/wikipedia/commons/7/79/Toompea_loss_2014.jpg" target="_blank">Toompea Castle, Talinn, Estonia</a></p>

Robbie

View solution in original post

4 Replies
Robbie_Grant
Community Coach
Community Coach

kbeimfohr​,

I am going to link to the original for credit, but yes, this can be done:

Open links in new tab

From stefaniesanders​,

to "force" a hyperlink to open in a new window or tab, the HTML of the page needs to be edited to insert a "new page" attribute. When editing the content page, click on the HTML Editor link at the upper right to switch to the HTML view for the page, then insert the target="_blank"attribute immediately after the quotation marks that end the URL. The code for a link to a picture of Toompea Castle on Wikimedia Commons looks like this:

<p><a href="https://upload.wikimedia.org/wikipedia/commons/7/79/Toompea_loss_2014.jpg" target="_blank">Toompea Castle, Talinn, Estonia</a></p>

Robbie

View solution in original post

Thanks Robbie.  This is not a huge problem for me, but I know most of the teachers I work with will not take the time to look at the code.  HTML scares them.  I guess I need to put a feature request in for this one.  It would be nice to have a checkbox that allowed you to "open in new window".

kbeimfohr​, as the original author of the posted solution (thanks,  @Robbie_Grant ​!), I am embarrassed to admit that until this very moment, when I searched for an existing feature idea link to give you, I didn't know about this other--easier!--solution, described in this archived feature idea:

I tested it in a sandbox course--first creating the hyperlink, then clicking Ctrl-K to open a dialog window--and it works! And, using this approach eliminates the need to navigate to the HTML view to edit the code.

So cool. I learn something new about Canvas every day. Smiley Happy I've updated the discussion to which Robbie linked to reflect this other solution.

admin19
Community Participant

I had a student loose part of an assignment because the link opened in the same window. I used this to change all my links to open in new windows. It worked like a charm. THANK YOU!!!!