1 2 3 | var selector = 'whatever-you-may-use-here'; $("#some-container").append('<div class="ccm-file-selector" data-file-selector="' + selector + '"></div>'); $('[data-file-selector=' + selector + ']').concreteFileSelector({'inputName': 'fID-' + selector, 'chooseText': 'Select an image', 'filters': [{"field":"type","type":1}] }); |
I hope that this was helpful :)
type:1 at the end is for images.
Other values for the file types can be found in the Type class from the Concrete\Core\File\Type namespace as follows:
1 2 3 4 5 6 7 8 | // File Type Constants const T_IMAGE = 1; //!< @javascript-exported const T_VIDEO = 2; //!< @javascript-exported const T_TEXT = 3; //!< @javascript-exported const T_AUDIO = 4; //!< @javascript-exported const T_DOCUMENT = 5; //!< @javascript-exported const T_APPLICATION = 6; //!< @javascript-exported const T_UNKNOWN = 99; //!< @javascript-exported |