Link media directly to the actual file, not the media route
Last updated on
26 February 2024
Linkit supports the ability to link to media uploaded in Drupal. Since Drupal "media" are entities (like nodes or taxonomy terms), by default, they have an internal Drupal "route" to a page with the media. However, in most cases, users trying to link to media actually want to link to the underlying file.
To make links created through Linkit's autocomplete point to the underlying file in the filesystem, do the following:
- Go to Configuration > Linkit (/admin/config/content/linkit).
- Select or create a Linkit profile.
- Click the "Manage matchers" tab.
- Click "Add matcher."
- Choose the "Media" matcher.
- Under "URL Substitution," choose "Direct URL to media."
Help improve this page
Page status: No known problems
You can:
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion