Edit on GitHub
Jump to docs navigation

Field types / Slug

Note: You are currently reading the documentation for Bolt 2.2. Looking for the documentation for Bolt 5.2 instead?

This field will determine what "slug" or permalink is used for accessing the record on the frontend. When omitted, the slug will be automatically generated.

Tip: The slug is a special value that's used in the generation of the URL at which a page will be available on the website. It usually contains a variant of the title, that's been made suitable for indexing by search engines. Ideally, it is both semantic and human-readable. For example, if you have a page named "About our company", a good slug would be about-our-company.

Basic Configuration:

        slug:
            type: slug
            uses: title

Example usage in templates:

The slug is not often used by itself, but rather as a part of a link. You can print the link to a record like this:

{{ record.link() }}

You can also just output the slug like this:

{{ record.slug }}

Options:

The field has one option to change the functionality of the field:

  • uses determines what field(s) are used to build the slug. Usually you want this set to the textfield that you use as the title, (often called title), but you can also use it with multiple fields like for example [title, subtitle].


Edit this page on GitHub
Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on Github.