Multiple Image/File Page Attribute
Permalink
Hi,
I need a multiple file attribute for 5.7, I have been toying around with it a little but haven't figured yet how to launch the file manager from the attributes dashboard page.
Adding a single file is easy enough with:
What I would like to do is have a select files button that launches the File Manager and comes back to the Attributes page with an array of files that I can save.
Has anyone else been looking into this or have some thoughts on how to do it.
thanks
I need a multiple file attribute for 5.7, I have been toying around with it a little but haven't figured yet how to launch the file manager from the attributes dashboard page.
Adding a single file is easy enough with:
$al = Loader::helper('concrete/asset_library'); $form = '<div class="ccm-attribute ccm-attribute-image-file">'; $form .= $al->file('ccm-file-akID-' . $this->attributeKey->getAttributeKeyID(), $this->field('value'), t('Choose File'), $bf); $form .= '</div>'; print $form;
What I would like to do is have a select files button that launches the File Manager and comes back to the Attributes page with an array of files that I can save.
Has anyone else been looking into this or have some thoughts on how to do it.
thanks
I don't have experience creating custom attributes, but I think I understand what you are trying to do.
In 5.7.4, a file manager multiple selection feature was added by olsgreen. This is the pull request that added the feature -https://github.com/concrete5/concrete5/pull/2055... .
User olsgreen kindly made a commented example showing how it it might be used.
The code above will launch the file manager and using multiple selection should return an array of objects for the selected items (including the fID).