Title and explanation at:
https://community.sellerdeck.com/for...esizing-images
The forum only lets you post 10 <img> tags thinking theu are images even though they are in code, so the layouts are on a number of posts - sorry!
Standard Promotional List Entry - Simple Image Revised July 2021
https://community.sellerdeck.com/for...esizing-images
The forum only lets you post 10 <img> tags thinking theu are images even though they are in code, so the layouts are on a number of posts - sorry!
Standard Promotional List Entry - Simple Image Revised July 2021
Code:
<actinic:block php="true" > include_once 'simpleImage.php'; error_reporting(E_ALL & ~E_NOTICE); $altname = '<actinic:variable name="CarouselCaption" encoding="perl" selectable="false" /> image'; $sOrigimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" /> = str_replace('\\','/', '<actinic:variable name="ItemImage" encoding="perl" selectable="false" />'); $scaleddir = 'scaled/'; $simpleimagebase = basename($sOrigimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" />); $splewidthlg = 1112; $splewidthmd = 993; $splewidthsm = 768; $splewidthxs = 576; $splefilelg = $scaleddir . 'splelg_' . $simpleimagebase; $splefilemd = $scaleddir . 'splemd_' . $simpleimagebase; $splefilesm = $scaleddir . 'splesm_' . $simpleimagebase; $splefilexs = $scaleddir . 'splexs_' . $simpleimagebase; try { if ( file_exists($sOrigimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" />) ) { $simpleimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" /> = new \claviska\SimpleImage($sOrigimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" />); $simpleimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" /> -> resize($splewidthlg) -> toFile($splefilelg); $simpleimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" /> -> resize($splewidthmd) -> toFile($splefilemd); $simpleimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" /> -> resize($splewidthsm) -> toFile($splefilesm); $simpleimagesple<actinic:variable encoding="perl" name="FragmentID" selectable="false" /> -> resize($splewidthxs) -> toFile($splefilexs); } } catch(Exception $err) { // Handle errors echo $err->getMessage(); } </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22ItemType%22%20%2f%3e%20%21%3d%202" > <div class="slide-entry"> <a href="<actinic:variable name="ItemLink" selectable="false" />"> <img class="d-none d-lg-block" src=<actinic:block php="true">echo "\"$splefilelg\" data-src=\"$splefilelg\" alt=\"$altname\" title=\"$altname\"";</actinic:block>"/> <img class="d-none d-md-block d-lg-none" src=<actinic:block php="true">echo "\"$splefilemd\" data-src=\"$splefilemd\" alt=\"$altname\" title=\"$altname\"";</actinic:block>"/> <img class="d-none d-sm-block d-md-none" src=<actinic:block php="true">echo "\"$splefilesm\" data-src=\"$splefilesm\" alt=\"$altname\" title=\"$altname\"";</actinic:block>"/> <img class="d-block d-sm-none" src=<actinic:block php="true">echo "\"$splefilexs\" data-src=\"$splefilexs\" alt=\"$altname\" title=\"$altname\"";</actinic:block>"/> </a> <actinic:block if="%3cactinic%3avariable%20name%3d%22CarouselCaption%22%20%2f%3e%20%21%3d%20%22%22" > <div class="carousel-caption"> <h3><actinic:variable name="CarouselCaption" /></h3> </div> </actinic:block> </div> </actinic:block> <actinic:block if="%3cactinic%3avariable%20name%3d%22ItemType%22%20%2f%3e%20%3d%3d%202" > <div class="slide-entry"> <a href="<actinic:variable name="ItemLink" selectable="false" />"> <img class="d-none d-lg-block" src=<actinic:block php="true">echo "\"$splefilelg\" data-src=\"$splefilelg\" alt=\"$altname\" title=\"$altname\"";</actinic:block>"/> <img class="d-none d-md-block d-lg-none" src=<actinic:block php="true">echo "\"$splefilemd\" data-src=\"$splefilemd\" alt=\"$altname\" title=\"$altname\"";</actinic:block>"/> <img class="d-none d-sm-block d-md-none" src=<actinic:block php="true">echo "\"$splefilesm\" data-src=\"$splefilesm\" alt=\"$altname\" title=\"$altname\"";</actinic:block>"/> <img class="d-block d-sm-none" src=<actinic:block php="true">echo "\"$splefilexs\" data-src=\"$splefilexs\" alt=\"$altname\" title=\"$altname\"";</actinic:block>"/> </a> </div> </actinic:block>