Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customizing URL alias patterns for file entities #6816

Open
ToniTen opened this issue Jan 9, 2025 · 1 comment
Open

Allow customizing URL alias patterns for file entities #6816

ToniTen opened this issue Jan 9, 2025 · 1 comment

Comments

@ToniTen
Copy link

ToniTen commented Jan 9, 2025

Description of the need

Right now, at /admin/config/urls/path/patterns one can customize the url for nodes, taxonomy and user accounts, but not for file entities. If you make the file display "Download link" so the file is requested through Backdrop, and not straight from the file system, the link ends up revealing the file ID (the link takes the form of https://example.com/file/[ID]/download?token=[token]

Proposed solution

Add an url alias pattern for files. Allow tokens to be used, and add "File display title" as a token.

Alternatives that have been considered

I think modern Drupal handles this through the core, but I stopped following Drupal when I decided that Drupal 8+ wasn't viable for my use case, and I'm rebuilding my sites using Backdrop after Drupal 7 EOL

Draft of feature description for Press Release (1 paragraph at most)

Backdrop now includes support for url aliases for file entities.

@indigoxela
Copy link
Member

Hey @ToniTen, welcome to the Backdrop issue queue. 👋

Path aliases for file entities have apparently been omitted on purpose, but can be added via hook.
File path.api.php contains an example for that: https://github.com/backdrop/backdrop/blob/1.x/core/modules/path/path.api.php#L141

I'm not sure if aliases for file paths are an 80% use case, but this functionality would be a great contrib candidate. I'm not aware of any existing project.

Re addition to core: let's wait for some feedback here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants