Skip to content

Conversation

@mjauvin
Copy link
Member

@mjauvin mjauvin commented Sep 2, 2025

This PR adds the iconClass config to the fileupload formwidget when mode = file. This complements the existing prompt config.

The config below:

fields:
  upload:
    type: fileupload
    mode: file
    prompt: Attach File
    iconClass: icon-paperclip

changes the formwidget look from this:
image

To this:
image

@mjauvin mjauvin added this to the 1.2.9 milestone Sep 2, 2025
@mjauvin mjauvin self-assigned this Sep 2, 2025
@mjauvin mjauvin added the needs review Issues/PRs that require a review from a maintainer label Sep 2, 2025
@mjauvin mjauvin requested a review from Copilot September 2, 2025 20:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new iconClass configuration option to the fileupload formwidget when mode is set to file, allowing developers to customize the icon displayed on the upload button. The change provides more flexibility in the visual appearance of file upload widgets.

  • Adds iconClass property to the FileUpload class with proper documentation
  • Updates the template to use the configurable icon class instead of hardcoded 'icon-upload'
  • Implements a fallback to 'icon-upload' when no custom icon class is provided

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
modules/backend/formwidgets/FileUpload.php Adds iconClass property, configuration loading, and variable preparation with fallback
modules/backend/formwidgets/fileupload/partials/_file_single.php Updates template to use configurable icon class variable

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mjauvin mjauvin requested a review from LukeTowers September 2, 2025 20:36
@LukeTowers
Copy link
Member

LGTM, can you submit a docs PR for this as well?

@mjauvin
Copy link
Member Author

mjauvin commented Sep 3, 2025

LGTM, can you submit a docs PR for this as well?

wintercms/docs#247

@LukeTowers LukeTowers merged commit 542d633 into develop Sep 3, 2025
13 checks passed
@LukeTowers LukeTowers deleted the fileupload-icon-class branch September 3, 2025 16:10
LukeTowers pushed a commit to wintercms/docs that referenced this pull request Sep 3, 2025
@LukeTowers
Copy link
Member

@mjauvin question I just thought of, does changing this change the icon injected into the prompt if the prompt is left as its default value?

@mjauvin
Copy link
Member Author

mjauvin commented Sep 3, 2025

No, it doesn't.

@mjauvin
Copy link
Member Author

mjauvin commented Sep 3, 2025

I'll submit a PR to add this

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

Labels

needs review Issues/PRs that require a review from a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants