08/11/2014 at 8:02 pm
#300492
Keymaster
@ Ciaran
Ok, the next release, here are a few examples on how you can get the image meta so you can build your own image tags:
/*
* Setup the $atts for the type of image you want.
*/
// To get the logo as originally uploaded.
$atts = array( 'type' => 'logo', 'size' => 'original' );
// To get the logo scaled to the size set in the settings.
$atts = array( 'type' => 'logo', 'size' => 'scaled' );
// To get the photo as originally uploaded.
$atts = array( 'type' => 'photo', 'size' => 'original' );
// To get the various image sizes as set in the settings.
$atts = array( 'type' => 'photo', 'size' => 'thumbnail' );
$atts = array( 'type' => 'photo', 'size' => 'medium' );
$atts = array( 'type' => 'photo', 'size' => 'large' );
// To get any random custom size (in pixels).
$atts = array( 'type' => 'photo', 'size' => 'custom', 'width' => 300, 'height' => 150 );
// Pass the $atts to the new getImageMeta() function.
$image = $entry->getImageMeta( $atts );
// Echo out the image tag.
echo "<img {$image['size']} src='{$image['url']}' />";
