Skip to content

Commit 5ebc4d7

Browse files
MC-22156: [PageBuilder] Content in Category Pages Aligning to Browser Margin Instead of Body Content Margin
1 parent 2a210db commit 5ebc4d7

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
9+
<body>
10+
<referenceContainer name="category.view.container">
11+
<referenceBlock name="category.description" template="Magento_PageBuilder::catalog/category/view/description.phtml"/>
12+
</referenceContainer>
13+
</body>
14+
</page>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
?>
7+
<?php
8+
// phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
9+
10+
/**
11+
* Category view template
12+
*
13+
* @var $block \Magento\Catalog\Block\Category\View
14+
*/
15+
?>
16+
<?php if ($description = $block->getCurrentCategory()->getDescription()) :?>
17+
<div class="category-description">
18+
<?php $descriptionHtml = $this->helper(Magento\Catalog\Helper\Output::class)->categoryAttribute(
19+
$block->getCurrentCategory(),
20+
$description,
21+
'description'
22+
);?>
23+
<?php if (stripos($description, 'data-appearance="contained"') === false) :?>
24+
<div data-content-type="row" data-appearance="contained" data-element="main">
25+
<div data-enable-parallax="0" data-parallax-speed="0.5" data-background-images="{}" data-element="inner" style="justify-content: flex-start; display: flex; flex-direction: column; background-position: left top; background-size: cover; background-repeat: no-repeat; background-attachment: scroll; border-style: none; border-width: 1px; border-radius: 0px; margin: 0px 0px 10px; padding: 10px;">
26+
<div data-content-type="html" data-appearance="default" data-element="main" style="border-style: none; border-width: 1px; border-radius: 0px; margin: 0px; padding: 0px;">
27+
<?= /* @noEscape */$descriptionHtml; ?>
28+
</div>
29+
</div>
30+
</div>
31+
<?php else : ?>
32+
<?= /* @noEscape */$descriptionHtml; ?>
33+
<?php endif; ?>
34+
</div>
35+
<?php endif; ?>
36+

0 commit comments

Comments
 (0)