cancel
Showing results for 
Search instead for 
Did you mean: 
Surveyor

Linking to an anchor on another page or file?

Jump to solution

Is there any way to link to an anchor on another page or file in Canvas?

I read through the helpful discussion on this blog post about linking to an anchor on another page, but it appears to not work in Chrome. Is there any way to link to an anchor in a file in Canvas? I haven't been able to get this to work because of the way the URL to the file is generated (i.e. the link ends with ".../files/4206745/download").

- Fred

Tags (4)
1 Solution

Accepted Solutions
Navigator II

Thanks laurakgibbs for tagging me into this thread. And Howdy fbidwell@ou.edu!

I believe your question is how to link to an anchor in a different page and in a file. So you want 2 answers, right? You cannot link to a specific spot in a file, just embed the file for download/preview. You can describe in words where you want the viewer to look in the file, but that's it.

Linking to a different page.. well by page do you mean a wiki content page, or a discussion, or an assignment, or a quiz page? I'm hoping you mean a different wiki content page, because it's absolutely do able just by following the similar steps from the Anchor Tags explained by a language teacher.‌ blog you mentioned - keep reading down in the comments.

I usually use 2 browser tabs to accomplish this linking to specific spot on another page. On the target page, I load up the anchor reference by adding #<idname> to the end of the URL for the page to make sure I am at the correct spot. So for instance: https://<SCHOOLNAME>/courses/1045344/pages/page-with-anchors#cantelope Then on the source page I'm linking from, I use that URL for the link. I play it safe and highlight my link text and use the link icon from the toolbar or CTRL-K so I can paste in the URL myself and be sure. (I like CTRL-K, I can put in mouse-hover text in the title field.)

In case you meant that you want to link to a specific spot on a discussion or assignment page type, I have little experience with linking to those. I will say that when I've done anchor-linking within an assignment page (using Tabs) that it works fine on the web browser but not fine on my mobile device.

When you say linking to anchor on another page does not work in Chrome, what is it that's happening? Is it only linking to the page itself and not to the right spot, or does it not even go to the new page? Screenshots would be helpful. And remember, you cannot link to a spot in a file.

Good luck,
Cheers - Shar

View solution in original post

8 Replies
Community Member

Hi fbidwell@ou.edu‌!!! I haven't played with that kind of content in Canvas, but I am pinging kona@richland.edu‌ in case maybe the tab/accordion script library might be relevant here. Just a guess. 

Also pinging ishar-uw‌ because she is the one who showed me how to get File content to show up in my Page iframes (which is how I manage javascripts: the scripts run in the File, and then the HTML content generated by the script runs safely in a Page, no security problems).

Navigator II

Thanks laurakgibbs for tagging me into this thread. And Howdy fbidwell@ou.edu!

I believe your question is how to link to an anchor in a different page and in a file. So you want 2 answers, right? You cannot link to a specific spot in a file, just embed the file for download/preview. You can describe in words where you want the viewer to look in the file, but that's it.

Linking to a different page.. well by page do you mean a wiki content page, or a discussion, or an assignment, or a quiz page? I'm hoping you mean a different wiki content page, because it's absolutely do able just by following the similar steps from the Anchor Tags explained by a language teacher.‌ blog you mentioned - keep reading down in the comments.

I usually use 2 browser tabs to accomplish this linking to specific spot on another page. On the target page, I load up the anchor reference by adding #<idname> to the end of the URL for the page to make sure I am at the correct spot. So for instance: https://<SCHOOLNAME>/courses/1045344/pages/page-with-anchors#cantelope Then on the source page I'm linking from, I use that URL for the link. I play it safe and highlight my link text and use the link icon from the toolbar or CTRL-K so I can paste in the URL myself and be sure. (I like CTRL-K, I can put in mouse-hover text in the title field.)

In case you meant that you want to link to a specific spot on a discussion or assignment page type, I have little experience with linking to those. I will say that when I've done anchor-linking within an assignment page (using Tabs) that it works fine on the web browser but not fine on my mobile device.

When you say linking to anchor on another page does not work in Chrome, what is it that's happening? Is it only linking to the page itself and not to the right spot, or does it not even go to the new page? Screenshots would be helpful. And remember, you cannot link to a spot in a file.

Good luck,
Cheers - Shar

View solution in original post

Thank you Laura and Sharmaine! 

Yes, my question is about linking to a specific spot on a wiki content page, not assignments or discussions. The technique described in the "Anchor Tags explained by a language teacher" post works well in Firefox but not Chrome.  In Chrome, the page just loads as normal, without going to the specific anchor spot.  In that post, James Jones speculated that "The IDs of elements on the page are not available when the page is loaded. The page is delivered using JavaScript and then it is displayed on the page. This means that when the browser tries to jump you to a specific tag, it's not available yet."

Here's a link to the page anchor: https://canvas.ou.edu/courses/50743/pages/meds2#m2p3

In Chrome it just loads the page, but not to the anchor.

It's helpful to know that I won't be able to link to a spot in a file, so I can stop trying to make that work. Smiley Happy

Worst case scenario, I can host the pages on a separate site and link to them from the course, which isn't too bad.

Sadness Smiley Sad I see precisely your dilemma Fred.

Works wonderful, fine, great in Firefox. Chrome.. definitely not so much. More the pity.

Alas - Shar

Surveyor

Hey fbidwell@ou.edu‌,

Since Chrome seems to be a dead end for the straightforward way to do this, let me brainstorm out loud for a moment. Bear in mind I did not test any of these just now.

1) You could create an HTML with anchors and add it to a module perhaps?

2) You could create a document in Google Docs with bookmarks or links to Headings and add that to a module using the https://community.canvaslms.com/docs/DOC-8732-canvas-release-google-apps-lti?sr=search&searchId=7e88...

3) Do the same as above except iframe the document instead of using the LTI (but I think the LTI is best)

Just a few thoughts. Let me know if anything works.

Oh, also, going way outside of the box (and your original question), sometimes the use of tabs or accordions can accomplish a similar goal of providing high level links to chunks of lower level content. So consider those as well.

Here's a good post on using those without the need for custom JS. Keep in mind at the time of that writing it wasn't supported on mobile (the content was there, but not the same functionality).

https://community.canvaslms.com/groups/designers/blog/2015/07/01/using-jquery-without-custom-javascr... 

Community Coach
Community Coach

Hello fbidwell@ou.edu‌...

I thought I would check in with you because there hasn't been any new activity in this particular discussion thread since March 23rd.  Have you had a chance to review all the above responses?  Did any of them ultimately help to answer your question?  Or, are you still looking for additional help with your original question?  If you feel that one of the above responses answered your question, please go ahead and mark it as "Correct".  But, if you are still looking for some help, please post a message below so that members of the Canvas Community can continue to assist you.  For now, I am going to mark your question as "Assumed Answered", but that won't prevent you or others from posting additional questions/comments below.  I hope this is okay with you.  Looking forward to hearing from you, Fred!

Thanks Chris.  I forgot to close this out.  I ended up hosting the html files that have anchors on another website and linked to them. It would be nice to be able to do this somehow in Canvas, but this workaround accomplished the goal. Thanks to everyone for the help! This thread helped me to rule out straightforward Canvas options.