Skip to content

Commit 9f0dcdc

Browse files
committed
Change containers into blocks to allow for caching
1 parent cafd044 commit 9f0dcdc

2 files changed

Lines changed: 27 additions & 11 deletions

File tree

view/base/layout/loki_base.xml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,33 @@
2626
</block>
2727
</container>
2828

29-
<container name="loki.script.store">
29+
<block name="loki.script.store" template="Loki_Base::container.phtml">
30+
<arguments>
31+
<argument name="cache_lifetime" xsi:type="number">86400</argument>
32+
</arguments>
33+
3034
<block name="loki.script.store.local-storage" template="Loki_Base::script/store/localstorage-store.phtml">
3135
<arguments>
3236
<argument name="section_config" xsi:type="object">Loki\Base\ViewModel\SectionConfig</argument>
3337
</arguments>
3438
</block>
3539

3640
<block name="loki.script.store.messages" template="Loki_Base::script/store/message-store.phtml"/>
37-
</container>
41+
</block>
3842

39-
<container name="loki.script.directive">
43+
<block name="loki.script.directive" template="Loki_Base::container.phtml">
4044
<block name="loki.script.directive.autoremove" template="Loki_Base::script/directive/autoremove-directive.phtml"/>
41-
</container>
45+
</block>
4246

43-
<container name="loki.script.component-partial"/>
44-
<container name="loki.script.component-type"/>
47+
<block name="loki.script.component-partial" template="Loki_Base::container.phtml">
48+
</block>
4549

46-
<container name="loki.script.component">
47-
<block name="loki.component.messages" template="Loki_Base::script/component/message-component.phtml"/>
48-
</container>
50+
<block name="loki.script.component-type" template="Loki_Base::container.phtml">
51+
</block>
4952

50-
<!-- legacy containers, do not use -->
51-
<container name="loki-components"/>
53+
<block name="loki.script.component" template="Loki_Base::container.phtml">
54+
<block name="loki.component.messages" template="Loki_Base::script/component/message-component.phtml"/>
55+
</block>
5256
</referenceContainer>
5357
</body>
5458
</page>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
use Loki\CssUtils\Util\CssClass;
5+
use Magento\Framework\View\Element\Template;
6+
7+
/** @var Template $block */
8+
/** @var CssClass $css */
9+
?>
10+
<div class="<?= /* @noEscape */ $css('') ?>">
11+
<?= /* @noEscape */ $block->getChildHtml(); ?>
12+
</div>

0 commit comments

Comments
 (0)