Skip to content

Commit c9d54ba

Browse files
author
Bohdan Berezhniy
committed
add option to exlude image from lazy load
1 parent 44e0caf commit c9d54ba

File tree

3 files changed

+72
-0
lines changed

3 files changed

+72
-0
lines changed

etc/di.xml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magefan ([email protected]). All rights reserved.
5+
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
6+
*
7+
* Glory to Ukraine! Glory to the heroes!
8+
*/
9+
-->
10+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
11+
<virtualType name="DefaultWYSIWYGValidator">
12+
<arguments>
13+
<argument name="allowedAttributes" xsi:type="array">
14+
<item name="mfdislazy" xsi:type="string">mfdislazy</item>
15+
</argument>
16+
</arguments>
17+
</virtualType>
18+
</config>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magefan ([email protected]). All rights reserved.
5+
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
6+
*
7+
* Glory to Ukraine! Glory to the heroes!
8+
*/
9+
-->
10+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_PageBuilder:etc/content_type.xsd">
11+
<type name="image">
12+
<appearances>
13+
<appearance name="full-width">
14+
<elements>
15+
<element name="desktop_image">
16+
<attribute name="exlude_from_lazy_load" source="mfdislazy"/>
17+
</element>
18+
<element name="mobile_image">
19+
<attribute name="exlude_from_lazy_load" source="mfdislazy"/>
20+
</element>
21+
</elements>
22+
</appearance>
23+
</appearances>
24+
</type>
25+
</config>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magefan ([email protected]). All rights reserved.
5+
* Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
6+
*
7+
* Glory to Ukraine! Glory to the heroes!
8+
*/
9+
-->
10+
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd" extends="pagebuilder_base_form">
11+
<fieldset name="general">
12+
<field name="exlude_from_lazy_load" sortOrder="90">
13+
<argument name="data" xsi:type="array">
14+
<item name="config" xsi:type="array">
15+
<item name="dataType" xsi:type="string">boolean</item>
16+
<item name="label" xsi:type="string" translate="true">Exlude From Lazy Load</item>
17+
<item name="formElement" xsi:type="string">checkbox</item>
18+
<item name="prefer" xsi:type="string">toggle</item>
19+
<item name="dataScope" xsi:type="string">exlude_from_lazy_load</item>
20+
<item name="valueMap" xsi:type="array">
21+
<item name="true" xsi:type="number">1</item>
22+
<item name="false" xsi:type="number">0</item>
23+
</item>
24+
<item name="default" xsi:type="number">1</item>
25+
</item>
26+
</argument>
27+
</field>
28+
</fieldset>
29+
</form>

0 commit comments

Comments
 (0)