Get images as objects

Permalink Browser Info Environment
Hi,

Thanks for this great add-on. Is it possible somehow to get the fileobjects, so that I can manipulate them myself?

The reason for this is, that I would like to manipulate the files like I have done for the thumbnail page attribute as shown below (but when I get the attribute for the multiple files attribute, I get a string of the download urls instead of an object)

$c = Page::getCurrentPage();
$thumbnail = $c->getAttribute("thumbnail");
if (is_object($thumbnail)) {
    $type = \Concrete\Core\File\Image\Thumbnail\Type\Type::getByHandle('medium');
    $type->setWidth("340");
    $type->setHeight("255");
    $img = Core::make('html/image', array($thumbnail));



thanks, in advance

Type: Discussion
Status: Resolved
pixel8
View Replies:
guyasyou replied on at Permalink Reply
guyasyou
Hi!
You need use Concrete\Package\PureMultipleFiles\Entity\Attribute\Value\Value::getFileObjects

$filesValue = $currentPage->getAttribute('handle');
if ($filesValue instanceof \Concrete\Core\Entity\Attribute\Value\Value\AbstractValue) {
$files = $filesValue->getFileObjects();
}

Is that what you were looking for?

concrete5 Environment Information

Most recent version

Browser User-Agent String

Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.