Kirby 5 is here! Learn more
Skip to content

Additional docs

Everything else that will need to be changed or added throughout the docs

Guide/Reference

Permissions

Page rendering

Content tokens

Replacing https://getkirby.com/docs/reference/system/options/content#salt-for-drafts-and-media-files: #6836

### Salt for page previews and media files

URLs of page previews and media files contain a hashed token that should be hard to guess. The tokens are based on the page URI or file ID and are authenticated with a salt value. In the way Kirby uses this salt value, it should ideally be a secret. By default, Kirby uses the filesystem path of the content folder. You can define your own salt that will be used instead:

\```php
return [
  'content' => [
    'salt' => '...'
  ]
];
\```

You can also dynamically generate a salt based on the model that needs a token:

\```php
return [
  'content' => [
    'salt' => function ($model) {
      return '...';
    }
  ]
];
\```

<since v="5.0.0">
The `$model` value is set to the `File` object when generating a media token for a file. For page preview tokens, `$model` is always passed as `null`. Your callback should return a fixed model-independent salt in this case.
</since>

Config reference for content.fileRedirects option

getkirby.com/docs/reference/system/options/content

  • Change the default to false
  • Change the first config example to set true
  • New alert box right after the first config example:
<alert>
Setting the option to `true` allows all visitors to download the uploaded file originals in full quality and resolution and with all metadata that the file carries. This can be a copyright, privacy or information security concern. Only set the option to `true` if none of your files require access protection.
</alert>

Cookbook

Global changes

  • Update examples of how to register a plugin throughout getkirby.com to use named arguments
  • Check where "Duplicating page: replace UUIDs with new ones #6567" could/should be mentioned in the docs