Skip to content

download attribute option for Link fields#16844

Merged
brandonkelly merged 3 commits into5.7from
feature/link-download
Mar 6, 2025
Merged

download attribute option for Link fields#16844
brandonkelly merged 3 commits into5.7from
feature/link-download

Conversation

@brandonkelly
Copy link
Copy Markdown
Member

@brandonkelly brandonkelly commented Mar 6, 2025

Description

Adds an optional “Download” attribute toggle to Link fields.

When enabled, a “Filename” field is also shown, which reveals the asset’s filename as a placeholder value (if an asset is selected).

A Link field, with “Download” and “Filename” advanced fields shown. The “Filename” input is blank, with a placeholder value of “IMG_1392.JPG”.

Links with “Download” enabled will get a download attribute added to their HTML, either sans value or set to the chosen filename.

craft\fields\data\LinkData has new download and filename properties, and Link fields’ full GraphQL data also now has new download and filename sub-fields.

Related issues

@brandonkelly brandonkelly merged commit 30a93d4 into 5.7 Mar 6, 2025
@brandonkelly brandonkelly deleted the feature/link-download branch March 6, 2025 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant