This article provides a reference to different types of links possible in the Web Management System (WMS).
Target audience: Site Administrators, Site Managers, Site Editors
In this article:
A relative link is a partial URL that points to a page in relation to the current one. The WMS recognizes that the relative link belongs to the same site, so the “mcgill.ca/sitename” part of the URL is not required. We recommend using relative links when pointing to pages that are located within your own WMS site. This will be useful if you use a staging site or change the site URL.
For example, if you are editing the home page of your website https://www.mcgill.ca/sitename and you want to link to another page within your site, such as the Contact page, you can enter the URL as: <a href="/contact">Contact</a>
If you are linking to the French version of a WMS page, you must include /fr/ in the URL.
Always test the link to ensure it works as expected.
Examples of relative links:
<a href="/">
(including a / takes you to the English home page of your site)<a href="/fr">
(including a /fr takes you to the French home page of your site, e.g., mcgill.ca/sitename/fr)<a href="/about-mcgill">
(e.g. mcgill.ca/about-mcgill)<a href="/fr/about-mcgill">
(e.g., mcgill.ca/sitename/fr/about-mcgill)<a href="/about-mcgill/history">
(e.g., mcgill.ca/sitename/about-mcgill/history)<a href="/fr/about-mcgill/history">
(e.g. mcgill.ca/sitename/fr/about-mcgill/history)Note: Relative links in the URL field of blocks and the path field of menu items must not include a slash at the beginning, or else you will see an error that the link is invalid. (The WMS has a built-in filter that adds the slash for these fields.)
Note: The above links are shown in HTML format. If you are using the WYSIWYG, you can remove the HTML elements such as <a href=”, “> and type only the / and what comes after in the URL itself.
To enter a relative link on a page using the WYSIWYG editor:
An absolute link includes the whole web address (URL). Absolute links should point to another McGill website or an external site outside of McGill.
Example:
For more information, visit the <a href="https://www.gg.ca/">
Governor General's website</a>
.
You can use the On This Page block to create a set of links to any anchors you have defined within the page. In smart mode, it links any H2 or H3 headings on your page. You can place the block in any of the block regions (right sidebar, top of page, top of content, bottom of page, bottom of content).
It is possible to link to content in a specific tab or accordion that is not open by default.
<ul class="tab-nav">
<li><a href="#">First</a></li>
<li><a href="#">Second</a></li>
<li><a href="#">Third</a></li>
<li><a href="#">Fourth</a></li>
</ul>
<ul class="tab-nav">
<li><a href="#">First</a></li>
<li><a href="#">Second</a></li>
<li><a href="#mylink">Third</a></li>
<li><a href="#">Fourth</a></li>
</ul>
<div>
that contains the tab content you wish to link to. In this case, you would find the <div>
above the third <h2>
heading: <div>
<h2>Third</h2>
<p>Aenean sapien massa, consectetur nec pretium sed, blandit in orci. Cras imperdiet egestas urna, sagittis euismod leo accumsan nec. Nullam vitae quam sit amet enim feugiat dictum. Ut gravida nisi at metus luctus condimentum elementum elit lobortis.
<div>
using the same text you used for the anchor:<div id="mylink">
<h2>Third</h2>
<p>Aenean sapien massa, consectetur nec pretium sed, blandit in orci. Cras imperdiet egestas urna, sagittis euismod leo accumsan nec. Nullam vitae quam sit amet enim feugiat dictum. Ut gravida nisi at metus luctus condimentum elementum elit lobortis.
A link to a tab will only work if it is placed on a different page or loaded from another browser window. This means that you can't paste in the URL www.mcgill.ca/sitename/tabbed-content-page#mylink on the same browser window where www.mcgill.ca/sitename/tabbed-content-page has already been loaded.
<div class="accordion">
<h3><a href="#">Title A</a></h3>
<div>
<p>Content A</p>
</div>
<h3><a href="#">Title B</a></h3>
<div>
<p>Content B</p>
</div>
<h3><a href="#">Title C</a></h3>
<div>
<p>Content C</p>
</div>
<h3><a href="#">Title D</a></h3>
<div>
<p>Content D</p>
</div>
</div>
<h3>
link: <div class="accordion">
<h3><a href="#mylink">Title A</a></h3>
<div>
<p>Content A</p>
</div>
<h3><a href="#">Title B</a></h3>
<div>
<p>Content B</p>
</div>
<h3><a href="#">Title C</a></h3>
<div>
<p>Content C</p>
</div>
<h3><a href="#">Title D</a></h3>
<div>
<p>Content D</p>
</div>
</div>
You can apply a link to a telephone number so that when clicked, it either opens the text messaging application or the telephone application on a user’s mobile device, depending on which protocol you specify. The user will then be able to type a text message to the number or be prompted to call the number.
Type the HTML with the following syntax:
We recommend setting custom aliases for each page in your site so the URL and URLs of all sub-pages will not dynamically change if you decide to change the title of your page. You can use the alias in a relative link or absolute link. When creating an alias, avoid using the underscore character (_) because it often looks like a space when a URL link is underlined. We recommend using a hyphen rather than an underscore when creating the alias.
If you move a page within your site's menu structure, the URL (and any sub-pages) will change to reflect the new path.
Note: The WMS Dashboard includes a report displaying URL aliases ending in a number, often indicating a duplicate page. Delete the duplicate page to remove the number from the URL.
In the WMS, there is a unique identifier for each piece of content on a site called a "node ID."
It is possible to create absolute or relative links using the node ID. However, node IDs are not recommended for linking to pages because the URL is not user-friendly or accessible. A link to a node number (e.g., www.mcgill.ca/sitename/node/123 ) doesn’t inform visitors of what to expect, whereas a link that contains a descriptive alias (e.g., www.mcgill.ca/sitename/about ) does. Furthermore, when a page’s URL alias is changed, a redirect is automatically created so that no broken links will occur.
Blocks, however, will not be automatically placed on the same page when a URL alias changes, so using node IDs is recommended for placing structural elements such as blocks. By referencing the node ID, they stay associated with the node even if the alias changes. Otherwise, the page visibility settings of blocks need to be manually updated if the page where they were set to display was referencing an alias.
If you reference the node ID, you need to keep that node published; do not attempt to create a new page in the future to replace the old one, or else the reference will be lost.
To find out the node ID of any page:
The node is also listed in My Workbench.
The node ID is different for the English and French versions of a page; you must repeat the instructions above for both versions and ensure you include /fr/ in the link so that the rest of the page (navigation, title, footer, blocks, etc.) also appears in French (providing you have already created a French version of that content).