cancel
Showing results for 
Search instead for 
Did you mean: 
emilycraddock
Community Member

Open links in new tab

Jump to solution

How can you get web links to pictures to open in a new tab?

If I have an image that is hyperlinked to an external website, I'd like it to open in a new tab.  Currently, when editing it, there is not "load in a new tab" option when you hyperlink to pictures and it always opens in the same tab and replaces Canvas, which isn’t ideal. 

2 Solutions

Accepted Solutions
Stefanie
Community Team
Community Team

emilycraddock​, 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>

View solution in original post

Stefanie
Community Team
Community Team

Thanks to a recent post by  @biray ​, I learned about another--easier--way to force links to open in a new window/tab--and this alternative method doesn't require any HTML editing.

Click on the hyperlink or highlight the words you want to change into a link, and then click Ctrl-K. This will open a pop-up window on the text that you want to link (or if you've already linked your text it will allow you to edit the link) where you can select the target to "open link in a new window" from the drop-down.

I've just tested this in a sandbox course, and it works like a charm!

View solution in original post

17 Replies
Stefanie
Community Team
Community Team

emilycraddock​, 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>

View solution in original post

Awesome- I tried it and it worked right away. Thanks!

This worked Brilliantly!

Stefanie, I work in Canvas on a Chromebook (which works great!).  When I use the ctrl-K solution or the coding solution you've mentioned it, the result I get is that a new window pops up to save the document as a file.  The file itself does not open, which I would rather it do.  Any thoughts on this?  Thanks!

 @amy_cliser ‌, to be clear, the CTRL+K solution is to set the target for a URL (link) in Edit mode; it's not meant to be used for file links. Try setting your preference for handling PDFs in Chrome. I searched Google and got this:

  1. On your computer, open Chrome.
  2. At the top right, click More Settings.
  3. At the bottom, click Advanced.
  4. Under "Privacy and security," click Content settings.
  5. Near the bottom, click PDF documents.
  6. Turn off Download PDF files instead of automatically opening them in Chrome.

Thank you Stephanie for the html solution.

Could Canvas implement an option to just click "open in new tab" like we can for automatically previewing a pdf link?

Stefanie
Community Team
Community Team

Thanks to a recent post by  @biray ​, I learned about another--easier--way to force links to open in a new window/tab--and this alternative method doesn't require any HTML editing.

Click on the hyperlink or highlight the words you want to change into a link, and then click Ctrl-K. This will open a pop-up window on the text that you want to link (or if you've already linked your text it will allow you to edit the link) where you can select the target to "open link in a new window" from the drop-down.

I've just tested this in a sandbox course, and it works like a charm!

View solution in original post

Hi Stefanie - thanks so much for this!  But when i tried it on my Mac, it was Command-K, not Ctrl-K.....then it worked great......

Ah, yes, nlatimer​, Mac, how could I possibly have forgotten about Mac??! :smileylaugh: Thanks for sharing that!