Announcement

Collapse
No announcement yet.

No Description Section Link Swift - Simple Image Revised July 2021

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

    No Description Section Link Swift - 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!

    Top Level Section - No Description Section Link Swift - Simple Image Revised July 2021

    Code:
    <actinic:block if="%3cactinic%3avariable%20name%3d%22SectionImageFileName%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="SectionName" encoding="perl" selectable="false" /> image';
    $sOrigimagendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" /> = str_replace('\\','/', '<actinic:variable name="SectionImageFileName" encoding="perl" selectable="false" />');
    $scaleddir = 'scaled/';
    $simpleimagebasendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" /> = basename($sOrigimagendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" />);
    $sxwidth = 420;
    $sxrwidth = 770;
    $sxfile = $scaleddir . 'sx_' . $simpleimagebasendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" />;
    $sxrfile = $scaleddir . 'sxr_' . $simpleimagebasendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" />;
    
    if ( file_exists($sOrigimagendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" />) )
    {
    $sxheight = ($sxwidth*(<actinic:variable encoding="perl" name="SectionImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="SectionImageWidth" selectable="false" />)) ;
    $sxrheight = ($sxrwidth*(<actinic:variable encoding="perl" name="SectionImageHeight" selectable="false" />/<actinic:variable encoding="perl" name="SectionImageWidth" selectable="false" />)) ;
    }
    
    try
    {
    if ( file_exists($sOrigimagendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" />) )
    {
    $simpleimagendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" /> = new \claviska\SimpleImage($sOrigimagendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" />);
    $simpleimagendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" /> -> resize($sxwidth) -> toFile($sxfile);
    $simpleimagendsl<actinic:variable encoding="perl" name="SectionID" selectable="false" /> -> resize($sxrwidth) -> toFile($sxrfile);
    
    }
    }
    catch(Exception $err)
    {
    // Handle errors
    echo $err->getMessage();
    }
    </actinic:block>
    </actinic:block>
    
    <div class="thumbnail section-thumbnail text-center bg-white theme-shadow-h">
    <div class="image">
    <a href="<actinic:variable name="SectionHref" />" target="_self" class="text-center align-items-center d-flex image-link">
    <img src=<actinic:block php="true">echo "\"$sxfile\" data-src=\"$sxfile\" alt=\"$altname\" width=\"$sxwidth\" height=\"$sxheight\"";</actinic:block> class="d-none d-md-block lazy lazyload img-responsive product-summary-image ml-auto mr-auto">
    <img src=<actinic:block php="true">echo "\"$sxrfile\" data-src=\"$sxrfile\" alt=\"$altname\" width=\"$sxrwidth\" height=\"$sxrheight\"";</actinic:block> class="d-none d-sm-block d-md-none lazy lazyload img-responsive product-summary-image ml-auto mr-auto">
    <img src=<actinic:block php="true">echo "\"$sxfile\" data-src=\"$sxfile\" alt=\"$altname\" width=\"$sxwidth\" height=\"$sxheight\"";</actinic:block> class="d-block d-sm-none lazy lazyload img-responsive product-summary-image ml-auto mr-auto">
    </a>
    <div class="caption">
    <a class="text-center" href="<actinic:variable name="SectionHref" />"><actinic:variable encoding="actinic" name="SectionName" /></a>
    </div>
    </div>
    </div>
    Jonathan Chappell
    Website Designer
    SellerDeck Website Designer
    Actinic to SellerDeck upgrades
    Graphicz Limited - www.graphicz.co.uk
Working...
X