-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Config "Category page" - layout, content width, products per row etc.
- Loading branch information
Showing
5 changed files
with
121 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Swissup\ThemeEditorSwissupAbsolute\Block\Adminhtml\System\Config\Form\Field; | ||
|
||
class ColumnsCount extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray | ||
{ | ||
/** | ||
* Prepare to render | ||
* | ||
* @return void | ||
*/ | ||
protected function _prepareToRender() | ||
{ | ||
$this->addColumn('width', ['label' => __('Min width, px')]); | ||
$this->addColumn('columns', ['label' => __('Columns')]); | ||
$this->addColumn('spacing', ['label' => __('Spacing, %')]); | ||
$this->_addAfter = false; | ||
$this->_addButtonLabel = __('Add columns exception'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Swissup\ThemeEditorSwissupAbsolute\Model\Config\Backend; | ||
|
||
class CategoryColumnsCount extends \Swissup\ThemeEditor\Model\Config\Backend\ColumnsCount | ||
{ | ||
/** | ||
* {@inheritdoc} | ||
*/ | ||
protected function getItemWidthValue($columns, $spacing) | ||
{ | ||
return "calc((100% - {$spacing}%) / {$columns})"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0"?> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> | ||
<virtualType name="Swissup\ThemeEditorSwissupAbsolute\Block\Adminhtml\System\Config\Form\Field\CategoryPagePreview" type="Swissup\ThemeEditor\Block\Adminhtml\System\Config\Form\Field\PagePreview"> | ||
<arguments> | ||
<argument name="previewData" xsi:type="array"> | ||
<item name="template" xsi:type="string">Swissup_ThemeEditor::config/category-page-preview.phtml</item> | ||
<item name="content_width" xsi:type="number">1280</item> | ||
<item name="header_width" xsi:type="number">1280</item> | ||
</argument> | ||
</arguments> | ||
</virtualType> | ||
<virtualType name="Swissup\ThemeEditorSwissupAbsolute\Model\Config\Backend\CategoryPageLayout" type="Swissup\ThemeEditor\Model\Config\Backend\PageLayout"> | ||
<arguments> | ||
<argument name="data" xsi:type="array"> | ||
<item name="themeCode" xsi:type="string">Swissup/absolute</item> | ||
<item name="handle" xsi:type="string">catalog_category_view</item> | ||
</argument> | ||
</arguments> | ||
</virtualType> | ||
<type name="Swissup\ThemeEditorSwissupAbsolute\Model\Config\Backend\CategoryColumnsCount"> | ||
<arguments> | ||
<argument name="data" xsi:type="array"> | ||
<item name="themeCode" xsi:type="string">Swissup/absolute</item> | ||
<item name="handle" xsi:type="string">catalog_category_view</item> | ||
</argument> | ||
</arguments> | ||
</type> | ||
</config> |