Skip to content

download attribute option for Link fields #16844

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

Merged
merged 3 commits into from
Mar 6, 2025
Merged

Conversation

brandonkelly
Copy link
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