Announcement

Collapse
No announcement yet.

Best Seller - Simple Image Revised July 2021

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Best Seller - Simple Image Revised July 2021

    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!

    Best Seller - Simple Image Revised July 2021

    Compact Best Seller Layout

    Code:
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductImageFileName%22%20%2f%3e%20%21%3d%20%22%22" >
    <actinic:block php="true" >
    include_once 'simpleImage.php';
    error_reporting(E_ALL & ~E_NOTICE);
    $altname = '<actinic:variable name="ProductName" encoding="perl" selectable="false" /> image';
    $sOrigimagebs = str_replace('\\','/', '<actinic:variable name="ProductImageFileName" encoding="perl" selectable="false" />');
    $scaleddir = 'scaled/';
    $simpleimagebase = basename($sOrigimagebs);
    $bslgwidth = 230;
    $bsmdwidth = 495;
    $bssmwidth = 767;
    $bsxswidth = 576;
    $bslgfile = $scaleddir . 'bslg_' . $simpleimagebase;
    $bsmdfile = $scaleddir . 'bsmd_' . $simpleimagebase;
    $bssmfile = $scaleddir . 'bssm_' . $simpleimagebase;
    $bsxsfile = $scaleddir . 'bsxs_' . $simpleimagebase;
    if ( file_exists($sOrigimagebs) )
    {
    $bslgheight = ($bslgwidth*(<actinic:variable encoding="perl" name="ProductImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="ProductImageWidth" selectable="false" />)) ;
    $bsmdheight = ($bsmdwidth*(<actinic:variable encoding="perl" name="ProductImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="ProductImageWidth" selectable="false" />)) ;
    $bssmheight = ($bssmwidth*(<actinic:variable encoding="perl" name="ProductImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="ProductImageWidth" selectable="false" />)) ;
    $bsxsheight = ($bsxswidth*(<actinic:variable encoding="perl" name="ProductImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="ProductImageWidth" selectable="false" />)) ;
    }
    try
    {
    if ( file_exists($sOrigimagebs) )
    {
    $simpleimagebsl = new \claviska\SimpleImage($sOrigimagebs);
    $simpleimagebsl -> resize($bslgwidth) -> toFile($bslgfile);
    $simpleimagebsl -> resize($bsmdwidth) -> toFile($bsmdfile);
    $simpleimagebsl -> resize($bssmwidth) -> toFile($bssmfile);
    $simpleimagebsl -> resize($bsxswidth) -> toFile($bsxsfile);
    }
    }
    catch(Exception $err)
    {
    // Handle errors
    echo $err->getMessage();
    }
    </actinic:block>
    </actinic:block>
    
    <div class="image">
    <a class="d-flex align-items-center justify-content-center overflow-hidden" href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable name="ProductID" />&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e" >&amp;SHOP=<actinic:variable name="ShopID" /></actinic:block>">
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductImageFileName%22%20%2f%3e%20%21%3d%20%22%22" >
    <img class="d-none d-lg-block lazyload lazy img-responsive" src=<actinic:block php="true">echo "\"$bslgfile\" data-src=\"$bslgfile\" alt=\"$altname\" width=\"$bslgwidth\" height=\"$bslgheight\"";</actinic:block> title="<actinic:variable encoding="strip" name="ProductName" />" >
    <img class="d-none d-md-block d-lg-none lazyload lazy img-responsive" src=<actinic:block php="true">echo "\"$bsmdfile\" data-src=\"$bsmdfile\" alt=\"$altname\" width=\"$bsmdwidth\" height=\"$bsmdheight\"";</actinic:block> title="<actinic:variable encoding="strip" name="ProductName" />" >
    <img class="d-none d-sm-block d-md-none lazyload lazy img-responsive" src=<actinic:block php="true">echo "\"$bssmfile\" data-src=\"$bssmmfile\" alt=\"$altname\" width=\"$bssmwidth\" height=\"$bssmheight\"";</actinic:block> title="<actinic:variable encoding="strip" name="ProductName" />" >
    <img class="d-block d-sm-none lazyload lazy img-responsive" src=<actinic:block php="true">echo "\"$bsxsfile\" data-src=\"$bsxsfile\" alt=\"$altname\" width=\"$bsxswidth\" height=\"$bsxsheight\"";</actinic:block> title="<actinic:variable encoding="strip" name="ProductName" />" >
    </actinic:block>
    <actinic:block if="%3cactinic%3avariable%20name%3d%22ProductImageFileName%22%20%2f%3e%20%3d%3d%20%22%22" >
    <img class="lazyload lazy img-responsive" data-src="<actinic:variable name="DefaultProductImage" />" src="<actinic:variable name="DefaultProductImage" />" />
    </actinic:block>
    </a>
    </div>
    <div class="caption">
    <a class="product-name" href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable encoding="url" name="ProductID" />&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e" >&amp;SHOP=<actinic:variable name="ShopID" /></actinic:block>"><span><actinic:variable name="ProductName" /></span></a>
    <div class="col-12">
    <div class="product-price-sec">
    <Actinic:PRICES PROD_REF="<actinic:variable name="ProductID" />" RETAIL_PRICE_PROMPT="<actinic:variable name="ProductPriceDescription" />">
    <actinic:variable name="PriceListRetail" value="Marketing Price List" />
    </Actinic:PRICES>
    </div>
    </div>
    </div>
    <p class="product-info">
    <a class="add-to-cart-btn" href="<actinic:variable name="SearchCGIURL" />?PRODREF=<actinic:variable encoding="url" name="ProductID" />&amp;NOLOGIN=1<actinic:block if="%3cactinic%3avariable%20name%3d%22IsHostMode%22%20%2f%3e" >&amp;SHOP=<actinic:variable name="ShopID" /></actinic:block>">
    <img src="cart-icon-w.png" class="cartIcon" alt="">
    </a>
    </p>
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk
Working...
X