Skip to content

Commit eedfd38

Browse files
author
Cari Spruiell
committed
MC-2369: Implement full width layout for category
- add Full Width option to Default Layout drop-downs and set as default selection - create full width layout for category description
1 parent 5fdd411 commit eedfd38

File tree

5 files changed

+79
-0
lines changed

5 files changed

+79
-0
lines changed

app/code/Magento/PageBuilder/etc/config.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,12 @@
2323
<column_grid_max>16</column_grid_max>
2424
</pagebuilder>
2525
</cms>
26+
<web>
27+
<default_layouts>
28+
<default_category_layout>fullwidth</default_category_layout>
29+
<default_product_layout>fullwidth</default_product_layout>
30+
<default_cms_layout>fullwidth</default_cms_layout>
31+
</default_layouts>
32+
</web>
2633
</default>
2734
</config>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
<referenceBlock name="category.description" template="Magento_PageBuilder::category/description.phtml"/>
11+
</body>
12+
</page>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/PageLayout/etc/layouts.xsd">
9+
<layout id="fullwidth">
10+
<label translate="true">Full Width</label>
11+
</layout>
12+
</page_layouts>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_layout.xsd">
9+
<update handle="2columns-left"/>
10+
<container name="columns.top.wrapper" htmlTag="div" htmlClass="page-main" htmlId="columns.top.wrapper"/>
11+
<move element="columns.top" destination="columns.top.wrapper"/>
12+
<move element="columns.top.wrapper" destination="page.wrapper" after="page.top"/>
13+
14+
<move element="category.view.container" destination="page.wrapper" after="columns.top.wrapper"/>
15+
16+
<container name="category.image.wrapper" htmlTag="div" htmlClass="page-main" htmlId="category.image.wrapper"/>
17+
<move element="category.image" destination="category.image.wrapper"/>
18+
<move element="category.image.wrapper" destination="category.view.container"/>
19+
20+
<container name="category.description.wrapper" htmlTag="div" htmlId="category.description.wrapper"/>
21+
<move element="category.description" destination="category.description.wrapper"/>
22+
<move element="category.description.wrapper" destination="category.view.container" after="category.image.wrapper"/>
23+
24+
<container name="category.cms.wrapper" htmlTag="div" htmlClass="page-main" htmlId="category.cms.wrapper"/>
25+
<move element="category.cms" destination="category.cms.wrapper"/>
26+
<move element="category.cms.wrapper" destination="category.view.container" after="category.description.wrapper"/>
27+
</layout>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
// @codingStandardsIgnoreFile
8+
9+
?>
10+
<?php
11+
/**
12+
* Category view template overridden to support full width layout of category description
13+
*
14+
* @var $block \Magento\Catalog\Block\Category\View
15+
*/
16+
?>
17+
<?php if ($_description = $block->getCurrentCategory()->getDescription()): ?>
18+
<div class="category-description pagebuilder-full-width">
19+
<?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Output')->categoryAttribute($block->getCurrentCategory(), $_description, 'description') ?>
20+
</div>
21+
<?php endif; ?>

0 commit comments

Comments
 (0)