> For the complete documentation index, see [llms.txt](https://salsa-digital.gitbook.io/govcms-site-builder/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://salsa-digital.gitbook.io/govcms-site-builder/unit-7-url-aliases/url-aliases/exercise-7-1-url-aliases-patterns.md).

# Exercise 7.1: URL aliases - Patterns

In this exercise, we’re going to automatically assign a URL alias pattern to the **Job Posting** content type so that all Job posting nodes will be assigned the URL alias format - <http://example.com/jobs/\\[node:title>]

## Add a new path alias pattern

1. Go to *Configuration* → *Search and metadata* → **URL aliases**, then click on the **Patterns** tab.

   Our new content type Job posting is not listed yet, so let’s create a new *Pathauto pattern*.<br>

   <figure><img src="/files/OdOCaXKWT8g3NkCaXdqo" alt=""><figcaption><p>SHowing existing URL Patterns</p></figcaption></figure>
2. Click the **Add Pathauto pattern** button.
3. Select **Content** in the **Pattern type** selector.
4. Select the **Job Posting** checkbox in the **Content type** selector.
5. Enter **Job Posting** in the **Label** field.
6. We need to find out which token to use in the **Path pattern** field so that it automatically takes our **Job posting** title and converts it into a safe URL. To explore available tokens, click the **Browse available tokens** link. In the **Available tokens** pop-up, expand **Nodes** and find **Title** field. Copy the token provided (\[node:title]) and update the **Path pattern** field with **jobs/\[node:title]**
7. Review the values and **Save** the form.\ <br>

   <figure><img src="/files/MxWH8HJTVSuSUzQUmbvt" alt=""><figcaption><p>Job URL alias pattern settings</p></figcaption></figure>

## Update existing paths

Now that we’ve created the new path alias, we also want to apply this new pattern to existing content, in this case **Job Posting** nodes. To do this, we’ll update all nodes on the site.

![Image of URL alias Patterns](/files/f4RsvdEicMMuQtH8uY0b)

1. Click on the **Bulk generate** tab at the top of the **Patterns** admin page.
2. Select **Content** paths.
3. Select **Generate a URL alias for un-aliased paths only**.
4. Click **Update**.

The new URL alias pattern has now been applied to existing content on your site.

To test it out, create some new **Job Postings** and you’ll see *Pathauto* automatically adding the new URL alias pattern to the pages when they’re saved.

<figure><img src="/files/vuw2SPi4qTgYPDQ1Avdd" alt=""><figcaption><p>Job alias is checked on creating a new Job Post</p></figcaption></figure>

{% hint style="warning" %}
**Note:** The URL alias field will only be populated *after* saving the content (as Draft, Needs review or Published).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://salsa-digital.gitbook.io/govcms-site-builder/unit-7-url-aliases/url-aliases/exercise-7-1-url-aliases-patterns.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
