Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This refers to Moodle 4.1 from December 2023 onwards

Excerpt

How to create a link to a section, resource or activity elsewhere in your module.

Include Page
Training_Page_Header
Training_Page_Header

How to: Create internal navigation links in your module   

As well as creating urls to external websites you can create internal links to resources or aspects of a page as well.  Internal links are useful for navigation around content heavy sections of your Moodle module site.

Note:  If you have collapsed topics you can only use internal links within a section, not to navigate from one section to another. HTML<iframe id="kaltura_player" src="https://cdnapisec.kaltura.com/p/1355621/sp/135562100/embedIframeJs/uiconf_id/13188771/partner_id/1355621?iframeembed=true&playerId=kaltura_player&entry_id=1_aqi8b1sp&flashvars[streamerType]=auto&amp;flashvars[localizationCode]=en&amp;flashvars[leadWithHTML5]=true&amp;flashvars[sideBarContainer.plugin]=true&amp;flashvars[sideBarContainer.position]=left&amp;flashvars[sideBarContainer.clickToClose]=true&amp;flashvars[chapters.plugin]=true&amp;flashvars[chapters.layout]=vertical&amp;flashvars[chapters.thumbnailRotator]=false&amp;flashvars[streamSelector.plugin]=true&amp;flashvars[EmbedPlayer.SpinnerTarget]=videoHolder&amp;flashvars[dualScreen.plugin]=true&amp;&wid=1_568pxgdo" width="456" height="292" allowfullscreen webkitallowfullscreen mozAllowFullScreen frameborder="0"></iframe>

Creating the anchor

The 'anchor' is thing you want to create a navigation link to, like a bookmark.

...

1. Go to your Moodle module

...

site and turn on the editing mode, using the toggle switch in the top navigation bar. The edit button toggle switch in Moodle 4.1Image Added

2. Within a Label or the description section of an activity, resource or a section, expand the formatting toolbar using the 'Show

...

/hide advanced buttons' button

The WYSIWYG editor on Moodle 4.1 showing the button for expanding the editing toolbar to show more optionsImage Added

3. Click on the HTML button

The WYSIWYG editor showing the HTML edit buttonImage Added

4. Find the piece of text you want to anchor, usually the title

5. Before the title paste in the following HTML code:  <span id="

...

TITLE OF THE ANCHOR">

6. Directly after the title paste in the following HTML code:  </span>

7. Click on the HTML button again to check that visually nothing has changed

8. Click Save

...

changes 

The save, cancel and return buttons when editing in Moodle 4.1Image Added

This will produce a hyperlink that you can click on and it will take you to the connected anchor.

  1. Go to your module in Moodle
  2. Within a Label or the description section of an activity, resource or a section, expand the formatting toolbar using the 'Show more buttons' button
  3. Click on the HTML button
  4. Find the piece of text you want to make a hyperlink to the anchor, this might be in a contents list
  5. Before the text paste in the following HTML code:  <a href="

...

  1. #TITLE OF ANCHOR">
  2. Directly after the title paste in the following HTML code:

...

  1.  </a>
  2. Click on the HTML button again to check that a hyperlink has been created but that visually nothing else has changed
  3. Click Save changes

Note:  The hyperlink isn't active in the editing mode , you can test it once you've clicked Save changes.so you need to turn editing off using the toggle switch on the top navigation bar. The edit button toggle switch in Moodle 4.1Image Added

Similar tutorials

The following other resources are also relevant to this topic:

...