Skip to main content
A slug is the part of a URL that names a page, for example littlebox-suite-helped-me-build-websites-faster in domain.com/news/littlebox-suite-helped-me-build-websites-faster. Clear slugs are easy to read and share, and they help search engines understand what the page is about. The “Littlebox Slug” field builds the slug of a document from its title. The frontend then finds the document through the API with that slug. This page explains the field itself. To set up the slug module (the default language in the URL, the home page and more), read the Slug guide.

Before you start

  • Turn on internationalization (i18n) for the content type. Without it, the field shows “Activate internationalization to use this feature.” instead of the slug.
  • Turn on the slug module in the Littlebox Strapi Suite. While the module is off, the field stays hidden.
  • Add a “Text” field called title to the content type. The slug follows this field.

Create the field

Step 1: Access the Strapi admin panel.
Step 2: Go to the Content-Type Builder.
Step 3: Select the collection type or single type that the frontend shows as a page.
Step 4: Click “Add another field”.
Step 5: Go to the Custom tab.
Step 6: Select “Littlebox Slug”.
Step 7: In the basic settings, type a name for the field, for example slug, and set “Attached field” to “Title”. The field needs an attached field.
Step 8: In the advanced settings, check “Enable localization for this field”, so every language has its own slug. Step 9: Click “Finish”, then click “Save”.

How the field works

In the Content Manager, the field shows the full path of the page: the language, the parent page and the slug. It follows the title. In a new document, the slug changes as you type the title. When you save the document for the first time, the slug stops following the title, so later title changes don’t break links that people already shared. Attach it again. To make the slug follow the title again, click the pin button next to “Edit”. The slug updates right away. Edit it by hand. Click “Edit” and type the slug you want. Editing stops the link to the title. Click the × button to cancel and go back to the previous slug.

The prefix

The gray text before the slug shows the start of the URL:
  • The language, for example /pt/. The default language shows only when “Show language slug” is on in the slug settings.
  • The parent page, when the document has one in its page attributes. For example, an article under “News” gets /news/ before its slug.

Slug rules

Strapi cleans what you type, so every slug is safe to use in a URL:

Unique slugs

Two documents can’t share the same slug under the same parent page in the same language. If you save a slug that is already in use, Strapi adds a number at the end to keep it unique, for example summer-sale-1764238500000. Change it by hand if you prefer a cleaner slug. The same slug can exist in different languages or under different parent pages, because the full URL is still different. For example, /news/launch and /blog/launch can both exist.

API

Strapi keeps the slug in the slug module, not in the field. Find a document by its slug with the pages endpoint:
The answer includes the full slug of the document and of its translations. Read the Slug guide for the full answer and the other endpoints.