Picture of Paul Steven
Internal Links to Articles, Blocks Components etc - How to
by Paul Steven - Thursday, 18 February 2016, 9:48 AM
 

I have been implementing some internal links within my course and thought it would be useful to document how I do this firstly to show others how to do this and secondly to check this is the best way to do this.

I create my hyperlinks in any of the text areas that include the WYSIWYG Source Button.

First thing I need to do is to get the unique ID of the element I want to link to. Fortunately with v0.15 of the Authoring Tool, there is a new feature that copies this ID to the clipboard. It is accessed by clicking on the cog in the top left of the page, article, block or component and selecting the "Copy ID to clipboard" option. This copies the unique ID to the clipboard and therefore enables you to paste it where needed.

The next step is to go to the element where you would like to add the hyperlink. This needs to be an element that has a WYSIWYG with a Source Button - the elements that include a Body text area generally include this. For example every article includes a Body element and every Block includes a Body element and components may also included a Body element. So there is plenty of opportunity where you can add these internal hyperlinks.

Anyway once you have chosen where to put the hyperlink, click on the "Source" button and add the link as follows:

<p><a href="./#PASTE YOUR UNIQUE CODE HERE">Link</a></p>

So you would start with the following:

<p><a href="./#">Link</a></p>

And paste the unique ID from your clipboard after the hash (#)

And the result will be something like this

<p><a href="./#56c2e6861bc8f0fc4566eec4">Link</a></p>

In my example I have used the word "Link" as the word my hyperlink is attached to. You can obviously change this to any word or series of words you like.

 

For those of you using an older version of the authoring tool, and therefore without the "Copy ID to clipboard" option you can still get the unique ID from the URL in the address bar in your browser when you have a particular element open for editing in the authoring tool.

For example I am editing an article and have the following in my address bar

http://localhost:5000/#/editor/56c2e6811bc8f0fc4566eebe/article/56c2e6821bc8f0fc4566eec2/edit

The unique ID for this article is the second but last segment of the URL

i.e 56c2e6821bc8f0fc4566eec2

That's it... 

Hopefully this has been of use to someone.

One word of warning - please check all your links before your final publish to check all the links work as it is possible the unique IDs could change if you do a lot of editing to your course such as copying/moving pages etc.

 

 

Picture of Helen Bailey
Re: Internal Links to Articles, Blocks Components etc - How to
by Helen Bailey - Thursday, 18 February 2016, 10:12 AM
 

What a great tip Paul - thanks for sharing!

Picture of John Niezen
Re: Internal Links to Articles, Blocks Components etc - How to
by John Niezen - Thursday, 18 February 2016, 11:19 AM
 

Great summary Paul.

Thanks a lot.

John

Picture of Sandra Neubauer
Re: Internal Links to Articles, Blocks Components etc - How to
by Sandra Neubauer - Wednesday, 24 February 2016, 11:38 AM
 

Thanks for the explanation, Paul!

I am now using a text component at the bottom of the page that contains a link to the next page (since I can't get the navigation plugin to work).

I had to make a small change to your code, though. It only linked to the right page when I added /id/ in between the # and the unique code:

<p><a href="./#/id/56c2e6861bc8f0fc4566eec4">Link</a></p>

Before it was sending me back to the home screen.

Picture of Paul Steven
Re: Internal Links to Articles, Blocks Components etc - How to
by Paul Steven - Wednesday, 24 February 2016, 12:00 PM
 

Thanks Sandra - I am glad my explanation helped even if it wasn't perfect:)

 

 

Picture of Pete Banks
Re: Internal Links to Articles, Blocks Components etc - How to
by Pete Banks - Tuesday, 8 March 2016, 2:52 AM
 

Hi Paul 

Great post we have the same issues as you.  

Did you make any progress with making the links into clickable Images?

Pete