Skip to content

Instantly share code, notes, and snippets.

@iamrobert
Created September 13, 2021 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamrobert/39eb044f47a756d191ff062c58525a36 to your computer and use it in GitHub Desktop.
Save iamrobert/39eb044f47a756d191ff062c58525a36 to your computer and use it in GitHub Desktop.
UCM FLEXIcontent IMAGE
<?php ob_start(); ?>
<?php
// captured from image field
if ( $mod_use_image && $item->image ):
if ( $item->image != "" ) {
$isotopePic = str_replace( "/s_", "/b_", $item->image );
list( $lsource_w, $lsource_h ) = getimagesize( JURI::base() . $isotopePic );
$imgDims = 'width="' . $lsource_w . '" height="' . $lsource_h . '" ';
}
?>
<img class="w100" src="<?php echo $isotopePic; ?>" <?php echo $imgDims;?> alt="<?php echo flexicontent_html::striptagsandcut($item->fulltitle); ?>" loading="lazy">
<?php // imagemissing
elseif ( $mod_use_image && $item->image == "" ): ?>
<img class="w100" src="<?php echo $nopic; ?>" width="370" height="370" alt="<?php echo flexicontent_html::striptagsandcut($item->fulltitle); ?>" loading="lazy">
<?php endif; ?>
<?php $captured_image = ob_get_clean(); $hasImage = (boolean) trim($captured_image); ?>
<div class="overflow-hidden">
<?php echo $captured_image;?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment