Use relative url if bundle type is 'file'.

Created on 11 April 2024, 8 months ago
Updated 12 April 2024, 8 months ago

Problem/Motivation

As stated on the module page, "Only canonical entities can be inserted."
It would be wonderful to use relative paths for files.

Steps to reproduce

Add a link using this module and see the path remains media/{id}

Proposed resolution

Add some logic that checks the bundle type for "file" and generate a relative path.

Remaining tasks

Maybe add some config to make this an option;
possibly take other types in to consideration.

User interface changes

None yet, but could add a config to enable this making it optional.

API changes

None.

Data model changes

None.

✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States cbfannin

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @cbfannin
  • πŸ‡ΊπŸ‡ΈUnited States cbfannin
  • Issue was unassigned.
  • πŸ‡ΊπŸ‡ΈUnited States cbfannin
  • πŸ‡³πŸ‡±Netherlands askibinski

    Yes, I'm sure it's doable. Then again you could argue that linking to media entities is a better way in combination with a module like `media_entity_download`. That way, when a file is replaced in a media item with a newer version, the link keeps working.

    But I'm open to review MR/patches if somebody wants to work on this. also referenced this issue from the project page.

Production build 0.71.5 2024