Issue #2894Opened July 14, 2020by HeyWrecker3 reactions

[Question]: How Do I Hide / Disable Dropzone in AM Modal

Question

Hello,

I've been reviewing the documentation and this link, trying to find the right configuration setting to disable the dropzone in the Asset Manager Modal. In my config, I have set the upload attribute to 0, and yet the dropzone still appears, is clickable, displays the system file browser, and allows me to select a file.

I would like to only allow people to select images from a pre-existing library, not upload images, but it is unclear to me how to disable this fully.

Additionally, as a side question- does the Asset Manager handle pagination of files at all? We have a pre-existing media library in our Django app that I can populate the images array with, but that list could be quite long. Breaking it up into categories will help (I've seen that you have instructions on how to do that), but I could still end up with a long, scrolling list of image assets.

Thanks in advance!

Best Regards, Rick Zawadzki

assetManager: { assets: images, // an array of images noAssets: '', upload: 0, uploadText: '', addBtnText: 'Not working either', dropzone: 0, openAssetsOnDrop: 0, modalTitle: 'Select an Image', }, <img width="1176" alt="Screen Shot 2020-07-14 at 3 10 36 PM" src="https://user-images.githubusercontent.com/3180594/87466453-450e4580-c5e4-11ea-8945-26372f9b9809.png">

Answers (3)

mcottretJuly 15, 20201 reactions

Hi @HeyWrecker !

As far as I know this is only possible by overriding the AM Modal's style like so:

.gjs {
  &-am {
    &-file-uploader {
      display: none;
    }

    &-assets-cont {
      width: 100%;
    }
  }
}

You can also see this issue regarding completely disabling image upload.

Cheers !

HeyWreckerJuly 15, 20201 reactions

@mcottret Hi Mathieu! Thanks for the advice! I'll try those steps out. I genuinely appreciate such a quick reply!

mcottretJuly 16, 20201 reactions

I see, sorry for the misunderstanding :)

I didn't know about this specific behaviour, but the assets from the loaded configuration might override the initial set value. You could try updating the assets list after loading the configuration like the following:

this.editor.on('storage:load', () => {
    this.editor.AssetManager.add(images);
    this.editor.AssetManager.render(images);
});

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.