-
-
Notifications
You must be signed in to change notification settings - Fork 227
Add iconClass config option for fileupload formwidget #1402
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
Conversation
There was a problem hiding this 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
iconClassproperty 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.
modules/backend/formwidgets/fileupload/partials/_file_single.php
Outdated
Show resolved
Hide resolved
|
LGTM, can you submit a docs PR for this as well? |
|
|
@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? |
|
No, it doesn't. |
|
I'll submit a PR to add this |
This PR adds the
iconClassconfig to the fileupload formwidget whenmode = file. This complements the existingpromptconfig.The config below:
changes the formwidget look from this:

To this:
