Working with slugs

Automatically generate preview links to quickly preview your content. The path to your content item consists of two parts: the domain construct and the slug construct. In Prepr you can easily manage both parts. Go to Settings > Publish > Models to manage the review URLs.

Domain construct

Your domain consists of the URL of your domain, such as https://example.com. You can use {id} and {slug} variables for your construct. Read more about review URLs.

Variables in the domain construct (example)

To use the content item id as well as the content item slug in your domain, your URL may be like:

Extra placeholders in domain construct (example)

You can easily add extra placeholders to your domain constructs, such as channels or topics. Your domain construct may then look like this.

Slug construct

A slug is part of a URL that usually describes the path to the specific content item: it is the part that comes after your domain name in the URL. You can use slug fields to auto-complete the slug construction. To add a slug to the model, click ' Add field' and select ' Slug'. You can only add one slug per model.

Build your slug construct

The slug field modal shows all available slug fields. Title, id and locale are slug fields by default, supplemented with all api_names of the text fields of the model. Click on a slug field to add it to the construct.

Using parent content items in the slug construct

You can also include linked parent content items in your slug construct. This is a huge asset for Prepr users who point through content item links to other content items in their Prepr account. If there is a content reference field in your model, there are two slug fields:
  • {api_id.id} to use the id of the linked content item in your slug
  • {api_id.slug} to use the slug of the linked content item in your slug

Example: In this example, we will use a content item that contains the following fields:

If you want to add the title in the slug, and refer to the linked content item, use the variable {publication.id}. Your slug construct should be: