Filemanager Widget

Creates an input field and a button in order to make it possible to upload files or to select already uploaded files. This widget checks if the responsive filemanager is present, if it is, the responsive filemanager will be used, else a fallback will be used, which is an input field of type 'file'.

Options

Type | data-filemanager-type | String | Optional

Provide the allowed file upload type. Currently there are 3 options which are:

  • 'all' - All file types are allowed
  • 'videos' - Only video files are allowed
  • 'images' - Only images are allowed If you don't provide any type, the filemanager will default to 'all'.

Content Directory | data-filemanager-content-directory | String | Required

Provide the directory which should be opened when the filemanager gets opened, e.g. 'media'. You can also provide a path from the root of your shop e.g 'images/slider_images'.

Name | data-filemanager-name | String | Required

The name of the input field. It will be set as the HTML name attribute.

Previous File | data-filemanager-previous-file | String | Optional

Name of the previous file. The name will be used in order to auto fill the input field.

Page | data-filemanager-page | String | Optional

The name of the current page in snake case, for example: new_category or responsive_filemanager. This option will be used in order to load custom configuration files for the responsive file manager like responsive_filemanager.config.php. These custom configuration files will be available or should be created in the 'page' directory of the responsive file manager.

Page Active | data-filemanager-page-active | Boolean | Required

This option is required in order to check whether the file manager module is active, and if the configuration option from the file manager is set to active, for the current page. If the module is not active, or active in general but not active for the current page, the fallback will be used, which is a standard input field.

Example

<div data-gx-widget="filemanager"
    data-filemanager-name="categories_icon" // Required
    data-filemanager-type="images" // Optional
    data-filemanager-content-directory="images/categories/icons" // Required
    data-filemanager-previous-file="filename.extension" // Optional
    data-filemanager-page="responsive_filemanager" // Optional
    data-filemanager-page-active="true"> // Required
</div>
Source: