Skip to content

Releases: elgentos/magento2-prismicio

Fixed the category helper

07 Nov 16:13
8aae5d9
Compare
Choose a tag to compare
  • Added an extend
  • Fixed a typo in the file name

Created support for meta robots block

03 Nov 13:37
Compare
Choose a tag to compare
1.11.1

Robots meta data block

Added a helper to get the category id automatically

28 Oct 12:47
6d856c3
Compare
Choose a tag to compare

What's Changed

  • Introduces a method getUid() that returns the category ID prefixed with 'category-' or an empty string if no current category can be found in the layer resolver (which I assume to be some kind of registry) #82

Full Changelog: 1.10.0...1.11.0

Image Block refactor (breaking change)

04 Oct 08:27
13069e2
Compare
Choose a tag to compare

This release contains a breaking change to the Image block. Prior to this release you needed to give the block the plain url for the image.

In this new release you can reference the image object. So the width, height and alt are set correctly on the image tag.

How to fix this breaking change in the code base:

  • search for all uses of this block: Elgentos\PrismicIO\Block\Dom\Image"
  • Change the .url to nothing like in the example below:
                <block class="Elgentos\PrismicIO\Block\Dom\Image" template="data.product.data.product_img.url" />
                <block class="Elgentos\PrismicIO\Block\Dom\Image" template="data.product.data.product_img" />

Also you can set classes with the css_classes data in this block like this:

            <arguments>
                <argument name="css_class" xsi:type="string">product</argument>
            </arguments>

Update image.php

04 Oct 08:34
a18cea6
Compare
Choose a tag to compare
Merge pull request #81 from elgentos/WouterSteen-patch-2

image block update 1.7 release line

Fixed redirect bug for pages that dont exist within prsmic

16 Sep 13:13
401e929
Compare
Choose a tag to compare
Merge pull request #78 from elgentos/WouterSteen-patch-1

Redirect page to new uid

Fixed redirect url

16 Sep 13:21
6cb6896
Compare
Choose a tag to compare
Merge pull request #79 from elgentos/WouterSteen-patch-2

Redirect to right url for 1.7 release line

1.9.2

18 Aug 12:11
Compare
Choose a tag to compare

What's Changed

  • Get all documents for the Magento Sitemap by @JoostWan in #74

New Contributors

Full Changelog: 1.9.1...1.9.2

Added a html serializer as suggested in #71

17 Jul 07:56
c5c2016
Compare
Choose a tag to compare

thank @speedupmate for rethinking and simplifying this...

Create the next class and use it in your layour.xml.

use Magento\Framework\View\Element\Block\ArgumentInterface;
use Prismic\Fragment\BlockInterface;

class Something implements ArgumentInterface
{

    public function __invoke(BlockInterface $block, string $content) 
    {
        // do what you want
    }

}

Fixed compatibility with Prismicsdk closure requirement

15 Jul 16:25
9e81a94
Compare
Choose a tag to compare

This will fix #71 thanks @speedupmate

To use a custom serializer in Magento you can create a plugin on \Elgentos\PrismicIO\ViewModel\HtmlSerializer::serialize
A afterSerialize would get string $result = null, \Prismic\Fragment\BlockInterface $object, string $content

function afterSerialize (null $result, \Prismic\Fragment\BlockInterface $object, string $content)
{
    if ($object->type === 'heading1') {
        return '<h1 class="awesome">' . $content . '</h1>';
    }

    return $result;
}

If a custom serializer does not return null that result will be returned, else the default serializer of Prismic will render the content