Frequently Asked Question

What are URLs, Paths, and Slugs?
Last Updated 3 years ago

Components of a URL

All content on every website is addressable by its URL (uniform resource locator).  The SD59 website is no exception.

image

A URL consists of several important parts: the protocol, the domain, and the path.

The domain component tells the web browser which server to talk to.

The protocol component tells the web browser which language to use when talking to the server.

The path component tells the web browser which information to ask for.  Paths are often split up into segments by forward slashes.  Each segment often indicates which part of the site's hierarchy you are accessing.

The slug is an informal term for the last segment of the path component.  In Drupal, the slug is often the only part of the path you have any influence on.

Best Practices

Slugs should be composed solely of lowercase letters, hyphens and numbers.

Slugs should always start with a letter.

Slugs should be descriptive of the content the node relationship refers to.  Ideally, you should be able to determine what content will be at any URL just by reading it.

Notes

When creating node relationships, much of its URL is already predetermined.  Here is how URLs are constructed:

  • All URLs for the SD59 website will start with https://www.sd59.bc.ca, as the SD59 web server speaks HTTPS.
  • All pages have the path prefix indicating which school or subsite it belongs to.  For schools, this is /schools/school-name.  These path segments are automatically generated.
  • If the content type allows for a slug, the slug will be used as the final segment of the path.
  • If the content type doesn't allow for a slug, a URL will still be generated based on a unique number in the system, but this is not intended to be directly linked to from other pages.

Every URL on a website must be unique.  Consequently, that means that slugs must also be unique within your school site or subsite.

When you create node relationships that fails to meet this criteria, Drupal will silently add numbers to the end of the URL to make it unique, which could potentially break links.  You can observe this by looking at the address bar while viewing the node relationship.  To correct this, you adjust the slugs on the offending node relationships.

Please Wait!

Please wait... it will take a second!