Skip to content

About

A page builder that lives inside your Symfony app. In-context editing with live preview of your real page, 19 ready-made blocks, extensible. No CMS lock-in. Works with Sylius.

Topics

Resources

Security policy

Stars

11 stars

Watchers

0 watching

Forks

Repository files navigation

ContentBlocks

A page builder that lives inside your Symfony app.

Build content areas from sections, columns and blocks — edited in-context, with a live preview of your real page. Framework-native, extensible, no CMS lock-in.

Packagist License Symfony PHP

▶️ Live demo · 📖 Documentation · 🚀 Quick start · 🧩 Block Kit · 🤖 For AI agents

The builder: a block's form in the sidebar, the page's real preview beside it

▶️ Try it live: blocks.clementmuller.fr — open the builder, edit a real page, publish. No install, nothing to sign up for.


The idea in 30 seconds

ContentArea is a generic, titleless, slug-less container of sections. It is not a page and has no URL — your app owns those. You attach it to your own entity with one Doctrine relation:

#[ORM\OneToOne(targetEntity: ContentArea::class, cascade: ['persist', 'remove'])]
private ?ContentArea $contentArea = null;
ContentArea  →  Section  →  Column  →  Block
 (container)    (layout)    (preset)   (type + JSON data)

The builder opens your real public page in an iframe and edits it in place, so the preview can never drift from production. That single design choice is why ContentBlocks drops into an app you already own instead of asking you to migrate into a CMS.

What it does — and deliberately doesn't

✅ ContentBlocks does ❌ ContentBlocks does not
Store structured content as your data Own your routing, URLs, or SEO
Render an in-context builder with live preview Ship a CMS, admin panel, or user management
Provide an extensible block-type system Force a CSS framework on you
Enforce your auth model via a thin interface Know who your users are — you wire that
Draft / publish / discard content states Replace your templating — you keep the markup

Install

composer require klehm/content-blocks klehm/content-blocks-kit
php bin/console doctrine:migrations:diff && php bin/console doctrine:migrations:migrate

Then attach a ContentArea, add ContentAreaType to a form, and call cb_render_content_area() in your template. Full walk-through: Quick start »

Packages

Package Description
klehm/content-blocks Core: entities, admin builder UI (Live Components + Stimulus), ContentAreaType, block-type system
klehm/content-blocks-kit 19 ready-to-use, self-contained blocks (title, text, image, gallery, button, card…)
klehm/content-blocks-i18n Optional content translation: one shared layout, per-locale values, a translation workbench

Vision

A page builder that feels like a native part of a Symfony application rather than a platform you migrate into:

  • Framework-native — Doctrine entities, Symfony forms, Live Components, Stimulus. No bespoke runtime, no proprietary storage.
  • Extensible before featureful — a block is one class + one form; #[AsContentBlock] auto-registers it. The form is the data whitelist and validator.
  • Host-owned, not tool-owned — your entity, URL, auth, and markup. ContentBlocks fills exactly one gap and gets out of the way.
  • Secure and predictable by default — deny-all access, CSRF everywhere, MIME/size-checked uploads. You opt into surface, never out of safety.

Contributing / monorepo

This repo is a monorepo. Packages are published separately to Packagist via splitsh/lite; the read-only mirrors (klehm/content-blocks, klehm/content-blocks-kit, klehm/content-blocks-i18n) are generated by CI. Contributors clone the monorepo and get everything — packages, three sandbox apps (Symfony with AssetMapper, Symfony 6.4 with Webpack Encore, Sylius), and the JS/PHP test suites.

git clone https://github.com/klehm/content-blocks-project.git
cd content-blocks-project
# set DATABASE_URL in apps/content-blocks-sandbox/.env.local, then:
make up      # installs, creates and seeds the database → http://127.0.0.1:8000

make up DEMO=sylius (or encore, all) starts the other sandboxes; make alone lists the rest (down, status, reset, test…).

Docs live in docs/ (VitePress). Run them locally with cd docs && npm install && npm run docs:dev. Planned and under-consideration work is tracked in ROADMAP.md.

Author & services

ContentBlocks is built with passion by Clément Muller, a freelance Symfony/Sylius developer.

Need a hand? I offer installation, integration and customization of ContentBlocks — custom blocks, theming to your design system, Sylius or legacy-app integration, migration of existing content. Get in touch through clementmuller.fr.

License

MIT

About

A page builder that lives inside your Symfony app. In-context editing with live preview of your real page, 19 ready-made blocks, extensible. No CMS lock-in. Works with Sylius.

Topics

Resources

Security policy

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages