Dropzonejs
Drag'n'drop file-attach uploads with image previews.
Official documentation
For more detailed information and examples, see the official documentation: Dropzone.js.
How to use?
Copy-paste the following <script>
near the end of your pages under JS
Nova to enable it.
Copy-paste the following <script>
near the end of your pages under JS Implementing
Plugins to enable it.
Copy-paste the init function under JS Plugins Init., before the closing </body>
tag, to enable it.
Preview template option
If you want to use an actual HTML element instead of providing a String as a config option, you could create a div with the ID and then put the template inside it.
Use data-options='{}'
attribute with parametrs and custom template #dropzoneItemTemplate
Methods
Options can be passed via data attributes or JavaScript. For data attributes, append the option name
to data-
, as in data-options=""
.
Attribute | Description |
---|---|
|
Has to be specified on elements other than form (or when the form doesn't have an action attribute). You can also provide a function that will be called with files and must return the url |
|
If null, the ratio of the image will be used to calculate it. |
|
The same as thumbnailWidth. If both are null, images will not be resized. |
|
A string that contains the template used for each dropped file. Change it to fulfill your needs but make sure to properly provide all elements. |