Managing URL aliases
Disclaimer: The content in this video remains relevant to Drupal 10 customers. An updated version of this training video is in the works and will be available soon.
Transcript
Introduction
Welcome to the GovCMS Content Administration Training series. Hi, I’m Ivan from Salsa Digital and in this video, you’ll learn about URL aliases in GovCMS.
We’ll cover the following two topics:
- What is a URL alias?
- How to customise URL aliases
What is a URL alias?
The URL to a page plays an important part in any website. Not just GovCMS. A good URL can help with search engine optimisation and information architecture. And it’s a better user experience if you add specific keywords in the URL.
So let’s take a look at this event page for example. Let’s take a look at the full URL in the address bar:
- The first part is the domain name and this would be something.gov.au
- And then after that we have what's called in GovCMS the URL alias (in WordPress it’s called Permalink and in other CMSs it’s called a slug, but in GovCMS and Drupal it’s called a URL alias)
The creation of these aliases is configured by the content type. When you create a page, an alias is automatically created. GovCMS comes with these patterns already configured.
Let’s go back to the content management area. So for example, if we look at a standard page the alias is based off the page title. It’ll be just “/” then the title. If we take a look at an event, you can see that the alias starts with “event/” then the title of the event. And if I go to configuration, URL aliases and click on Patterns, we can see what GovCMS comes with:
- Blog article
- Event
- FOI
- News and media
- Standard page
I should mention that to access this page you’ll need to have the site administrator role and the patterns could look a little different on your site, as it’s common to change the patterns depending on the site architecture.
How to customise URL aliases
We talked about what a URL alias is and how they're automatically generated. But now let’s create a page and customise the alias.
Click on Add content and let’s create a News and media page. And we’ll enter in the title of “Latest agency changes” and some dummy text. Then save it as ‘Needs review’, then publish.
Up the top, you can see the URL is “/news-and-media/” and then the title of the news and media page is used in the URL alias, which is “latest-agency-changes”. But what if we want to customise the URL alias just for this page? We can do that by clicking Edit, and in the right-hand column, you should see URL ALIAS.
If you can’t see it, then you need to be given access to this section. You can see that the checkbox “Generate automatic URL alias” has already been checked — that’s why the alias was automatically created. But if we uncheck it we can customise the alias. So let’s remove the word “latest-” and click on Save.
Now you can see the URL alias has just been changed on this page. It’s no longer “/latest-agency-changes”, it’s “/agency-changes”."
Recap
Let’s now recap what we covered in this video. First, we learnt what a URL alias is, then we looked at how to customise them.