Template file_link is difficult to alter

Created on 17 May 2016, about 8 years ago
Updated 3 February 2023, over 1 year ago

Problem/Motivation

In order to add target="_blank" to a file link, I had to replicate most of template_preprocess_file_link. The documentation for $variables['attributes'] ("An associative array of attributes to be placed in the a tag") is wrong after πŸ“Œ Use CSS for file icons in file fields Fixed

Proposed resolution

Add URL options variable to the template which includes attributes. See #29

This may be deprecated eventually: #2615660: Allow Link and LinkGenerator::generate() to provide attributes. β†’

Remaining tasks

Review the patch and change record.

User interface changes

API changes

Data model changes

✨ Feature request
Status

Needs work

Version

10.1 ✨

Component
File moduleΒ  β†’

Last updated 3 days ago

Created by

πŸ‡ΈπŸ‡ͺSweden Arla

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request β†’ as a guide.

    @imclean I do think this could use a test case. To least show that altering works as expected.

Production build 0.69.0 2024