Thumbnail Helper
Permalink
Is it possible to use the image helper to create a thumbnail from an image URL or do you have to use a concrete 5 image object. How would I do that?
I'm doing this on a Page List Template. Here's my code to this point. I'm also VERY open to doing this in a better way, because I'm sure there's a better way to do this using the API...
I'm doing this on a Page List Template. Here's my code to this point. I'm also VERY open to doing this in a better way, because I'm sure there's a better way to do this using the API...
<?php defined('C5_EXECUTE') or die("Access Denied."); $cArray = $pl->get($itemsToGet = 100, $offset = 0); function callback($buffer){ preg_match('/(http:\/\/){0,1}[A-Za-z.\/0-9-%_,]+[.]{1}[A-Za-z]+/', $buffer, $matches); $imgUrl=$matches[0]; return "<img src='{$imgUrl}' />"; // Here, I would like to output a thumbnail instead } ?> <ul id="inventoryList"> <?php $isFirst = true; //So first item in list can have a different css class (e.g. no top border) $excerptBlocks = ($controller->truncateSummaries ? 1 : null); //1 is the number of blocks to include in the excerpt $truncateChars = ($controller->truncateSummaries ? $controller->truncateChars : 20);
Viewing 15 lines of 37 lines. View entire code block.
What version of concrete5 are you using?