Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

https://github.com/magesuite/image-resize

This module contains helpers for image resize.

Installation

This module is required by magesuite-cms-tag-manager and magesuite-image-resize, which are part of core package

Installation if metapackage is not used:

composer require "creativestyle/magesuite-image-resize" ^1.0.0

Admin settings

There is no admin setting for this module.

Backend

Backend documentation need to be added

Example of usage in magesuite-cms-tag-manager/Service/Mapper/CmsPageDataMapper.php

public function mapPage($page)
{
    $imageUrl = '';

    if ($page->getCmsImageTeaser()) {
        $imageUrl = $this->imageResize->getUrl($page->getCmsTeaserImageUrl(), self::CMS_TEASER_MODULE, self::CMS_TEASER_IMAGE_ID);
    }

    $pagesData = [
        'id' => $page->getId(),
        'headline' => $page->getTitle(),
        'href' => $this->cmsPageHelper->getPageUrl($page->getId()),
        'image' => [
            'src' => $imageUrl,
            'srcSet' => $imageUrl ? $this->imageResize->resolveSrcSet($page->getCmsTeaserImageUrl(), self::CMS_TEASER_MODULE, [self::CMS_TEASER_IMAGE_ID, self::CMS_TEASER_IMAGE_ID_2X]) : ''
        ],
        'displayVariant' => 2
    ];

    return $pagesData;
}

Frontend

There are no frontend features in this module.

  • No labels