create image thumbnails from multiple files attribute package
Permalink
Hi,
I would like to achieve adding more images to a blog post, and for that I have installed thehttps://www.concrete5.org/marketplace/addons/multiple-files-attribut... package.
It works really great and supports the composer as well, but the only thing that is causing me trouble like hell, is that I can not manipulate with the images I get. They are only displayed from the following code of the attribute controller of the package :
What I would like to achieve is, that I would like to fetch the files from the array from the page_attribute and then create/display image thumbnails in correct sizes like I've done here:
I just can't figure out how I can do this.. I've tried different things like getting the files from fID, but when I do
But although I get an object, when I try to manipulate it, I get a message that it is null :-(
Can anyone help me achieve getting the array of images and being able to work with them?
All help is VERY appreciated!!
I would like to achieve adding more images to a blog post, and for that I have installed thehttps://www.concrete5.org/marketplace/addons/multiple-files-attribut... package.
It works really great and supports the composer as well, but the only thing that is causing me trouble like hell, is that I can not manipulate with the images I get. They are only displayed from the following code of the attribute controller of the package :
public function getDisplayValue() { $html = ''; $filesValue = $this->attributeValue->getValue(); if (is_object($filesValue)) { $filesArray = $filesValue->getFileObjects(); if (count($filesArray) > 0) { $this->addHeaderItem(\Core::make('helper/html')->css('/'.DIRNAME_PACKAGES.'/pure_multiple_files/attributes/pure_multiple_files/view.css')); $html .= '<div class="display_multiple_files multiple_files_akID_'.$this->getAttributeKey()->getAttributeKeyID().'">'; foreach ($filesArray as $file) { /** @var \Concrete\Core\File\File $file */ $fv = $file->getRecentVersion(); $html .= '<div class="file">'; $html .= '<div class="thumb">'; $html .= '<a href="'.$fv->getDownloadURL().'" title="'.$fv->getTitle().'">';
Viewing 15 lines of 41 lines. View entire code block.
What I would like to achieve is, that I would like to fetch the files from the array from the page_attribute and then create/display image thumbnails in correct sizes like I've done here:
I just can't figure out how I can do this.. I've tried different things like getting the files from fID, but when I do
File::getByID($fID);
But although I get an object, when I try to manipulate it, I get a message that it is null :-(
Can anyone help me achieve getting the array of images and being able to work with them?
All help is VERY appreciated!!