Smile-SA/elasticsuite

View on GitHub
src/module-elasticsuite-tracker/view/frontend/layout/default.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0"?>
<!--
/**
 * Smile Tracker default layout
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Smile ElasticSuite to newer
 * versions in the future.
 *
 * @category  Smile
 * @package   Smile\ElasticsuiteTracker
 * @author    Romain RUAUD <romain.ruaud@smile.fr>
 * @copyright 2020 Smile
 * @license   Open Software License ("OSL") v. 3.0
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <script src="Smile_ElasticsuiteTracker::js/tracking.js" />
    </head>
    <body>
        <referenceBlock name="head.additional">
            <block template="Smile_ElasticsuiteTracker::config.phtml"
                   class="Smile\ElasticsuiteTracker\Block\Config"
                   name="smile.tracker.config"
                   ifconfig="smile_elasticsuite_tracker/general/enabled">
                <arguments>
                    <argument name="userConsentScript" xsi:type="string">Smile_ElasticsuiteTracker/js/user-consent</argument>
                    <argument name="userConsentConfig" xsi:type="array">
                        <item name="cookieRestrictionEnabled" xsi:type="helper" helper="\Magento\Cookie\Helper\Cookie::isCookieRestrictionModeEnabled" />
                        <item name="cookieRestrictionName" xsi:type="string">user_allowed_save_cookie</item>
                    </argument>
                </arguments>
            </block>
        </referenceBlock>
        <referenceContainer name="before.body.end">
            <block class="Smile\ElasticsuiteTracker\Block\Variables\Page\Base"
                   name="smile.tracker.page.base"
                   ifconfig="smile_elasticsuite_tracker/general/enabled" />
            <block class="Smile\ElasticsuiteTracker\Block\Variables\Page\Catalog"
                   name="smile.tracker.page.catalog"
                   ifconfig="smile_elasticsuite_tracker/general/enabled" />
        </referenceContainer>
    </body>
</page>