Skip to content

🚀 What is PageBlocks

PageBlocks is not just an add-on, but a full-fledged data and interface management platform for MODX.
It allows developers to build project architecture from controllers, tables, blocks, and templates, while managers can fill the site without involving a programmer.

🏗️ What it is built on

Four load-bearing pieces, all of them standard tools rather than home-grown ones:

LayerWhat does the work
DatabaseEloquent — models, relations, scopes, a query builder
SchemaPhinx migrations — no xPDO maps to regenerate
RoutingFastRoute — your own URLs, not just resource aliases
TemplatespbFenom — our hardened Fenom fork

That combination is what lets you write a controller, a route and a model the way you would in a modern framework, while the site stays a MODX site.

PageBlocks is for everyone:

  • 🧑‍💼 Managers – simple and intuitive interface. Pages are assembled from ready-made blocks that can be edited, copied, reordered, and published.
  • 👨‍💻 Beginner developers – blocks, tabs, tables, and fields can be configured directly in the admin panel, no coding required.
  • 🧑‍💻💻 Professional developers – full control via IDE: controllers, routes, templates, and files. Projects become predictable and scalable.

🌟 Key Features

🧩 1. Page builder with blocks

Pages are assembled from pre-built blocks, like LEGO bricks.
Managers simply select the needed blocks, rearrange them, and fill in content—no coding required.

🖥️ 2. Easy admin panel workflow

Create blocks, tables, fields, tabs, panels, and menus directly in the interface—without writing code.
Perfect for beginner developers.

💻 3. Full code control

Controllers, routes, middleware, validation rules, templates and the API are files in your IDE — versioned, reviewable, testable.

Blocks, tables and fields are the other half: those are built in the admin panel, and that is on purpose. Their shape is what a manager edits every day, so it belongs where a manager can see it — while the logic that renders them stays in your repository.

🧠 4. Intuitive interface

Everything in one place: blocks, tables, pages, translations.
No unnecessary tabs or complex configurations.

⚡ 5. Fast website deployment

No need to reinvent the wheel every time.
Create landing pages, catalogs, and websites 2–3 times faster than with traditional MODX templating.

🧱 6. Built for MODX 3

PageBlocks requires MODX 3.0+ and PHP 8.2+, and the installer enforces both. Eloquent 12 and Phinx 0.16 need a modern PHP; there is no way around that.

🛠️ 7. Flexible field types

PageBlocks provides 39 field types—from simple text and images to galleries, maps, Editor.js, icons, selects, checkboxes, and relations.
Fields can be repeated, grouped, made conditional, and even embed tables inside blocks—offering flexibility for any interface.

🔄 8. Built-in pagination, filtering & multilingual support

Filters, lists, language versions, translations—all included.
No extra components needed.

🔧 9. Modularity & reusability

Blocks can be reused across different pages and projects.
A block saved as reusable keeps a link to its master copy, and you choose which fields stay in sync.

🧾 10. Built-in Fenom templating

Templates are rendered by pbFenom, our fork of Fenom shipped as a Composer package.
Use chunks, file: templates or @INLINE strings:

php
{foreach $items as $item}
  <div class="product">{$item.title}</div>
{/foreach}

🔎 11. Query Builder

query() returns an Illuminate query builder over the MODX database. Pass a table name without the prefix — the connection adds it:

php
{foreach query('site_content')->where('template', 4)->orderBy('menuindex')->get() as $page}
	<a href="{$page->uri}">{$page->pagetitle}</a>
{/foreach}

Rows come back as plain objects, so fields are read as properties ($page->uri), not through a getter. For resources there is a shorter way — see Helpers.

🧰 12. Snippets for MODX templates

Seven snippets are registered on install, so the component is reachable from an ordinary MODX template without adopting the whole framework:

[[!pbList? &model=`PbResource` &parent=`[[*id]]` &tpl=`chunk:myItem` &limit=`10`]]

pbList, pbBlocks, pbResources, pbUsers, pbMenu, pbFilters, pbJson — see Snippets.

⚡ 13. pbFetch – Painless AJAX

A native JavaScript class for sending GET, POST, PUT, DELETE requests without page reloads.
Works with declarative attributes like pb-form, pb-trigger, pb-target, etc.

📊 14. Flexible UTM Tag Handling

PageBlocks allows you to control block visibility based on UTM tags. This can be configured in the admin interface. Ideal for personalization, marketing, and A/B testing.

🔌 15. REST API with tokens

Any constructor table can be published through the generic API with a checkbox: pick the public name, the exposed fields and the allowed operations. Clients authenticate with a bearer token, not a manager session, and the component describes itself through OpenAPI.

🛡️ 16. Security at all levels

CSRF, access rights, validation, SQL injection protection—all built-in and preconfigured.

🚀 17. Continuous development

The component is actively evolving: new features, improvements, documentation.
PageBlocks is not a one-time module but a long-term solution.

🎯 Conclusion

PageBlocks is a stable, flexible, and scalable tool that eliminates routine work.
If you build sites on MODX—install it first.
It will save days or weeks of work—for both managers and developers.

🛠️ Support

  • Version: 3.0.0-alfa
  • MODX Support: 3.0+
  • PHP Support: 8.2+
  • Author: Boshnik

🐞 Report an Issue

If you find a bug in PageBlocks, create an issue in the GitHub repository.

© PageBlocks 2019-present