├── .gitattributes ├── .github └── FUNDING.yml ├── registration.php ├── etc ├── module.xml └── adminhtml │ └── di.xml ├── composer.json ├── Plugin └── AddCodeButtonToToolbarConfigPlugin.php ├── LICENSE.md ├── CHANGELOG.md └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | /docs export-ignore 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: markshust 4 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /etc/adminhtml/di.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "markshust/magento2-module-pagebuildersourcecode", 3 | "description": "The Page Builder Source Code module adds a Source Code button to the toolbar of the Page Builder WYSIWYG editor.", 4 | "require": { 5 | "php": "^7||^8", 6 | "magento/framework": "^100|^101|^102|^103", 7 | "magento/module-page-builder": "^1||^2" 8 | }, 9 | "type": "magento2-module", 10 | "version": "2.0.1", 11 | "license": [ 12 | "MIT" 13 | ], 14 | "autoload": { 15 | "files": [ 16 | "registration.php" 17 | ], 18 | "psr-4": { 19 | "MarkShust\\PageBuilderSourceCode\\": "" 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Plugin/AddCodeButtonToToolbarConfigPlugin.php: -------------------------------------------------------------------------------- 1 | addCodeButtonToToolbarConfigWithKey($resultConfig, 'tinymce'); 15 | $this->addCodeButtonToToolbarConfigWithKey($resultConfig, 'settings'); 16 | 17 | return $resultConfig; 18 | } 19 | 20 | private function addCodeButtonToToolbarConfigWithKey(DataObject $config, string $key): void 21 | { 22 | $specificConfig = $config->getData($key) ?? []; 23 | if (isset($specificConfig['toolbar'])) { 24 | $specificConfig['toolbar'] .= ' | code'; 25 | $config->setData($key, $specificConfig); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [2025] Mark Shust 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) 5 | and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). 6 | 7 | ## [2.0.0] - 2025-03-12 8 | 9 | Tagging as major release, since implementation has completely changed. 10 | 11 | ### Fixed 12 | - Use plugin to support all versions of Magento [PR #13](https://github.com/markshust/magento2-module-pagebuildersourcecode/pull/13). 13 | - Above update also fixes "removes format and line height icons" issue [#12](https://github.com/markshust/magento2-module-pagebuildersourcecode/issues/12). 14 | 15 | ## [1.0.5] - 2024-03-06 16 | 17 | ### Fixed 18 | - Fixed Magento widget and variable icons disappearing after installing this module [PR #9](https://github.com/markshust/magento2-module-pagebuildersourcecode/pull/9). 19 | 20 | ## [1.0.4] - 2021-12-20 21 | 22 | ### Fixed 23 | - Fixed bullet list icon missing from TinyMCE4 editor [PR #7](https://github.com/markshust/magento2-module-pagebuildersourcecode/pull/7). 24 | 25 | ## [1.0.3] - 2021-10-28 26 | 27 | ### Fixed 28 | - Updated deps to resolve PHP and MF version constraint issues [#4](https://github.com/markshust/magento2-module-pagebuildersourcecode/issues/4). 29 | 30 | ## [1.0.2] - 2019-10-18 31 | 32 | ### Fixed 33 | - Updated composer version constraints to support newer versions of Magento. 34 | 35 | ## [1.0.1] - 2019-08-28 36 | 37 | ### Fixed 38 | - Updated dependencies to support Magento 2.3.2 [PR #2](https://github.com/markshust/magento2-module-pagebuildersourcecode/pull/2). 39 | 40 | ## [1.0.0] - 2019-05-27 41 | 42 | ### Added 43 | - Initial release. 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MarkShust_PageBuilderSourceCode 2 | 3 | Adds a Source Code button to the toolbar of the Page Builder WYSIWYG editor. 4 | 5 | Supported Magento Versions 6 | Latest Stable Version 7 | Composer Downloads 8 | Maintained - Yes 9 | 10 | 11 | ## Table of contents 12 | 13 | - [Summary](#summary) 14 | - [Requirements](#requirements) 15 | - [Installation](#installation) 16 | - [Usage](#usage) 17 | - [Credits](#credits) 18 | - [License](#license) 19 | 20 | ## Summary 21 | 22 | Page Builder does not come with a way to edit the HTML source code when editing a text block. Sometimes it is desired to override the default styles and edit the HTML manually. This module adds the "code" icon to the toolbar to allow this capability. 23 | 24 | If you'd like to learn a bit more about why & how you'd use this module, check out the explainer video of this module, created by Webverse. 25 | 26 | ## Requirements 27 | 28 | This module requires the Page Builder module, which comes installed with Magento Commerce 2.3.1+. 29 | 30 | ## Installation 31 | 32 | ``` 33 | composer require markshust/magento2-module-pagebuildersourcecode 34 | bin/magento module:enable MarkShust_PageBuilderSourceCode 35 | bin/magento setup:upgrade 36 | ``` 37 | 38 | ## Usage 39 | 40 | This module has no configuration. Just install, and you'll see the code icon in the Page Builder WYSIWYG editor toolbar. 41 | 42 | ![Screenshot](https://raw.githubusercontent.com/markshust/magento2-module-pagebuildersourcecode/master/docs/demo-20250312.png) 43 | 44 | ## Credits 45 | 46 | ### M.academy 47 | 48 | This repository is sponsored by M.academy, the simplest way to learn complex tech skills. 49 | 50 | M.academy 51 | 52 | ## License 53 | 54 | [MIT](https://opensource.org/licenses/MIT) 55 | --------------------------------------------------------------------------------