When we prepare our customers to work with the CMS, we give them the advice to group the Assets. Especially when multiple users are entering content.
The new feature to upload a file is very efficient, but it doesn't give you the opportunity to put the file in a certain sub folder. This may be confusing for our customers and it can create a big bulk of same files in a global folder.
That is why I want to ask if it is possible to give us the option to disable this button for the content managers whenever we feel there is a need to?
Thank you.
Robin Braibant
Statik
The new Upload button is nice, but I agree that it isn't always necessary/wanted. Would be great if it was possible to turn it off on a per-field basis (i.e. a new setting for Asset fields).
This button was added partly in response to https://github.com/craftcms/cms/issues/2778 which better surfaced the ability directly upload files by dragging and dropping into an assets field (which isn't something we train our clients on). However I'm in agreement that better exposing this functionality is potentially going to lead to users more often than not skipping the "Add an asset" button and using "Upload a file".
Whether or not this is desirable I think depends on how you are choosing to manage Assets. If you're setting a specific upload location folder based on the current element e.g. volume/{entry.title}
then I can see how this is perfectly reasonable. But if you are taking a more curated approach and instead organising Assets by subject e.g. an images volume which subfolders such as "People", "Landscapes" then providing providing a one click "stick it anywhere" option is more problematic.
There are a number of reasons the second option is preferable, primarily it makes finding and reusing images in a curated image library easier. At the end of the day users are still going to organise assets badly and revert to dumping them into the default location but at least before they were forced to use the Assets browser so there was at least a chance they _might_ organise them sensibly.
Ideally the upload button and drag n drop onto a field were an option.
If we added this setting, it would disable drag-n-drop uploading as well, agreed?
I have to agree, I need a way to turn this "Upload Files" button off. It's making many of my asset fields confusing. At face value it looks like two buttons that do the same thing, but just named differently. It's also especially troublesome when using the Embedded Assets plugin also.
An example:
The top choice is to add a Vimeo video using Embedded Assets. But I also have an "Upload a File" button now that hints that the user can upload a video, when that is not the case at all.
The bottom choice just looks like two buttons that do the same thing. When my clients start seeing this, it's going to be pretty confusing to them. I expect I am going to have to answer a few emails from them. Would very much like the option to make this new "Upload a File" button optional.
I feel like this adds confusion too and would like to remove it. Clients are just going upload their images multiple times instead of checking first. 99% of them aren't even aware they can draft images into the browser so I don't mind that functionality going away.
@brandonkelly Why would drag and drop need to be disabled if the extra button is disabled?
Could the "Add an image" button also be a drop target to upload to the predefined asset source?
Or, if these buttons are staying, how about they were labelled something like "Select an _image_" and "Add a new _image_" ?
Personally I thought the workflow of clicking to add an asset which opens the Assets modal where the asset can be selected or a new asset uploaded was great. This feels like it's solving a problem that isn't there (at least one I've never encountered).
Why would drag and drop need to be disabled if the extra button is disabled?
Could the "Add an image" button also be a drop target to upload to the predefined asset source?
Because the button is just an alternative UI for drag-n-drop uploading to Assets fields, and the complaint here is that the whole idea of uploading directly to the field can be undesired, in cases where you want the author to choose exactly where the file should be uploaded, rather than leaving it up to the Default Upload Location setting.
Are you saying you want the client to retain the ability to drag-n-drop files, but you donât want them to be able to visually see that they can do that? Whatâs the point then?
Or, if these buttons are staying, how about they were labelled something like "Select an _image_" and "Add a new _image_" ?
See https://github.com/craftcms/cms/issues/6939#issuecomment-702966416.
Personally I thought the workflow of clicking to add an asset which opens the Assets modal where the asset can be selected or a new asset uploaded was great.
To be clear, this _only_ concerns the initial field UI, not the modal window. Nothing in there will change.
This feels like it's solving a problem that isn't there (at least one I've never encountered).
See https://github.com/craftcms/cms/issues/2778#issuecomment-696709124 for context.
Just added a new setting to Assets fields for the next release, which resolves this.
Great compromise! Thanks @brandonkelly !
Great resolution
I was here to just say âď¸me too! But this solution means it's all an improvement on the previous version. Win!
Craft 3.5.13 is out now with that new setting â¨
@brandonkelly thank you for making this an optional field... I have never checked for a CraftCMS update as eagerly.
I am noticing that the default option is ON.
To recap,
I personally will need to spend over an hour changing 20+ fields in order to maintain the status quo of the CraftCMS I am supporting.
I am wondering, is there a way to change this via a SQL query globally?
- A new "Upload an Image" button was introduced system-wide in a CMS update. The button was automatically added next to every single image asset selection field.
@andreimoment Yes the button was added, but the ability to upload files directly to an Assets field is nothing new. It has always been possible via drag-n-drop. The button simply adds a more intuitive UI for it.
- The default setting of this now optional feature is ON, which means anyone who doesn't want it added to their CP needs to disable it, for every single image asset field.
There was a consensus that this new setting should affect both the button and the ability to upload via drag-n-drop _(see https://github.com/craftcms/cms/issues/6954#issuecomment-703635099 which at present has 10 đs and zero đs)_. So having the setting be disabled by default would cause a regression of a firmly established feature.
I am wondering, is there a way to change this via a SQL query globally?
Iâd suggest making the change via your project config, which would be safer.
Go to Utilities â Project Config and click the âRebuildâ button (or run php craft project-config/rebuild
). That will cause all of your Assets fieldsâ project config YAML files to be updated with the new allowUploads
setting.
Open your config/project/fields/
folder in a text editor, and find/replace all allowUploads: true
instances with allowUploads: false
.
Open config/project/project.yaml
in a text editor and tweak the dateModified
value and save it.
Reload the Utilities â Project Config page, and click the âApply changes onlyâ button (or run php craft project-config/apply
).
@brandonkelly thank you for the detailed and thoughtful response.
It is very useful to see how powerful the YAML configuration files are and that it is possible to make setting changes via direct edits.
I ended up completing the updates via the CP, but will definitely consider the direct route if faced with repetitive changes in the future.
Also appreciate your pointing out the discussion behind the decision to add the button as a default.
Most helpful comment
If we added this setting, it would disable drag-n-drop uploading as well, agreed?