# markshust/magento2-module-pagebuildersourcecode

> The Page Builder Source Code module adds a Source Code button to the toolbar of the Page Builder WYSIWYG editor.

`composer require markshust/magento2-module-pagebuildersourcecode`

Canonical URL: https://packagento.com/markshust/magento2-module-pagebuildersourcecode

## At a glance

- **Vendor**: markshust (https://packagento.com/markshust.md)
- **Latest version**: 2.0.1 — released 2025-03-17
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/markshust/magento2-module-pagebuildersourcecode and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require markshust/magento2-module-pagebuildersourcecode:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

The Page Builder Source Code module adds a Source Code button to the toolbar of the Page Builder WYSIWYG editor.

## README

Adds a Source Code button to the toolbar of the Page Builder WYSIWYG editor.

<img src="https://img.shields.io/badge/magento-^2.3.2-brightgreen.svg?logo=magento&longCache=true&style=flat-square" alt="Supported Magento Versions" />
<a href="https://packagist.org/packages/markshust/magento2-module-pagebuildersourcecode" target="_blank"><img src="https://img.shields.io/packagist/v/markshust/magento2-module-pagebuildersourcecode.svg?style=flat-square" alt="Latest Stable Version" /></a>
<a href="https://packagist.org/packages/markshust/magento2-module-pagebuildersourcecode" target="_blank"><img src="https://poser.pugx.org/markshust/magento2-module-pagebuildersourcecode/downloads" alt="Composer Downloads" /></a>
<a href="https://GitHub.com/Naereen/StrapDown.js/graphs/commit-activity" target="_blank"><img src="https://img.shields.io/badge/maintained%3F-yes-brightgreen.svg?style=flat-square" alt="Maintained - Yes" /></a>
<a href="https://opensource.org/licenses/MIT" target="_blank"><img src="https://img.shields.io/badge/license-MIT-blue.svg" /></a>

### Table of contents

- [Summary](#summary)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Credits](#credits)
- [License](#license)

### Summary

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.

If you'd like to learn a bit more about why & how you'd use this module, check out the <a href="https://www.youtube.com/watch?v=12oyP-4Iebw" target="_blank">explainer video of this module</a>, created by <a href="https://www.youtube.com/channel/UCnkPBx_DwgNcdz_-TJSI-tg" target="_blank">Webverse</a>.

### Requirements

This module requires the Page Builder module, which comes installed with Magento Commerce 2.3.1+.

### Installation

```
composer require markshust/magento2-module-pagebuildersourcecode
bin/magento module:enable MarkShust_PageBuilderSourceCode
bin/magento setup:upgrade
```

### Usage

This module has no configuration. Just install, and you'll see the code icon in the Page Builder WYSIWYG editor toolbar.

![Screenshot](https://raw.githubusercontent.com/markshust/magento2-module-pagebuildersourcecode/master/docs/demo-20250312.png)

### Credits

#### M.academy

This repository is sponsored by <a href="https://m.academy" target="_blank">M.academy</a>, the simplest way to learn complex tech skills.

<a href="https://m.academy" target="_blank"><img src="https://m.academy/images/logo.png" alt="M.academy"></a>

### License

[MIT](https://opensource.org/licenses/MIT)

## Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

### [2.0.0] - 2025-03-12

Tagging as major release, since implementation has completely changed.

#### Fixed
- Use plugin to support all versions of Magento [PR #13](https://github.com/markshust/magento2-module-pagebuildersourcecode/pull/13).
- Above update also fixes "removes format and line height icons" issue [#12](https://github.com/markshust/magento2-module-pagebuildersourcecode/issues/12).

### [1.0.5] - 2024-03-06

#### Fixed
- Fixed Magento widget and variable icons disappearing after installing this module [PR #9](https://github.com/markshust/magento2-module-pagebuildersourcecode/pull/9).

### [1.0.4] - 2021-12-20

#### Fixed
- Fixed bullet list icon missing from TinyMCE4 editor [PR #7](https://github.com/markshust/magento2-module-pagebuildersourcecode/pull/7).

### [1.0.3] - 2021-10-28

#### Fixed
- Updated deps to resolve PHP and MF version constraint issues [#4](https://github.com/markshust/magento2-module-pagebuildersourcecode/issues/4).

### [1.0.2] - 2019-10-18

#### Fixed
- Updated composer version constraints to support newer versions of Magento.

### [1.0.1] - 2019-08-28

#### Fixed
- Updated dependencies to support Magento 2.3.2 [PR #2](https://github.com/markshust/magento2-module-pagebuildersourcecode/pull/2).

### [1.0.0] - 2019-05-27

#### Added
- Initial release.

## Recent Versions

| Version | Released |
|---|---|
| 2.0.1 | 2025-03-17 |
| 2.0.0 | 2025-03-12 |
| 1.0.5 | 2024-03-07 |
| 1.0.4 | 2021-12-20 |
| 1.0.3 | 2021-10-28 |
| 1.0.2 | 2019-10-18 |
| 1.0.1 | 2019-08-28 |
| 1.0.0 | 2019-05-27 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | ^100\|^101\|^102\|^103 |
| magento/module-page-builder | ^1\|\|^2 |
| php | ^7\|\|^8 |

## Quality

Latest release (2.0.1) passes the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Pass | 0 |  |
| PHPMD | Warning | 1 | 1 rule violation (UnusedFormalParameter:1) |
| Cpd | Pass | 0 |  |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["markshust/magento2-module-pagebuildersourcecode"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

markshust is a Magento 2 vendor on Packagento. See https://packagento.com/markshust.md for their full catalogue.

