Pushword, an open-source Symfony CMS
Pushword is an MIT-licensed Symfony CMS. Editors write pages in the admin, and developers control the layout in Twig. An existing Symfony application can keep its own controllers and Doctrine entities while Pushword manages the editorial pages.
Try a field in a new project first. The same field and Twig template work when you add the CMS to an application that already has routes.
Start a new Symfony CMS project
The starter includes the administration interface, a local SQLite database and demo pages. Pushword requires PHP 8.5 or 8.6 and Symfony 8.2 or later in the 8.x series. Check the PHP extensions in the installation guide before running Composer.
composer create-project pushword/new workshop-site "^1.0"
cd workshop-site
php -S 127.0.0.1:8004 -t public/
Open http://127.0.0.1:8004/admin and use the account created during installation.
Add a typed field to a page
Declare a workshop duration in config/packages/pushword.yaml. The editor gets a number field in the page form.
pushword:
page_properties:
duration_minutes:
type: int
constraints:
- Positive: ~
Create _content.html.twig in templates/localhost/page/ to print the duration above the page body. Replace localhost with your site’s main host if you changed it.
{% extends '@Pushword/page/_content.html.twig' %}
{% block main_content %}
{% set minutes = page.getCustomProperty('duration_minutes') %}
{% if minutes is not null %}
<p>Duration: {{ minutes }} minutes</p>
{% endif %}
{{ parent() }}
{% endblock %}
Clear the local template lookup cache with php bin/console cache:pool:clear cache.app. In the admin, create a page titled Bike workshop and write its body. Set Duration minutes to 90. Publish the page and open /bike-workshop. It shows Duration: 90 minutes above the body. The validator rejects -1 if you try to save that value.
Pushword stores the field in the page’s JSON properties. Use your own Doctrine entity when the data needs relations or dedicated indexes. The page property guide covers per-site schemas and how declared fields sync with Markdown.
Add Pushword to an existing Symfony application
Start on a branch with a copy of your database. Check your Symfony version and Composer constraints against the starter’s requirements before installing the page editor.
composer require --no-scripts "pushword/core:^1.0" "pushword/admin:^1.0" "pushword/admin-block-editor:^1.0"
In config/bundles.php, put Pushword\Core\PushwordCoreBundle before the other bundles. Check the registrations for the admin and block editor. Add VichUploaderBundle from the Vich\UploaderBundle namespace if Flex left it out. Append these imports to config/routes.yaml so your application’s routes stay ahead of the CMS catch-all.
pushword_admin:
resource: '@PushwordAdminBundle/AdminRoutes.yaml'
pushword_admin_block_editor:
resource: '@PushwordAdminBlockEditorBundle/AdminBlockEditorRoutes.yaml'
pushword:
resource: '@PushwordCoreBundle/Resources/config/routes.yaml'
Check the firewall and user provider before putting the admin on the application host. If config/packages/security.yaml is the untouched Symfony recipe and the app has no authentication of its own, remove that stub in the test branch. Pushword then supplies the configuration. The recipe’s empty access_control key can otherwise conflict with the bundle rules when Symfony compiles the container.
Keep the security file when it already protects the application. Review how its login and access rules will coexist with the CMS before deploying to the same host. A separate CMS application keeps both sets of rules independent. The starter script removes the stock security file as part of setting up a new application. Core install script
If the existing app has its own templates/base.html.twig, set a per-host template override for the CMS. For the default local host, put {% extends '@Pushword/base.html.twig' %} in templates/localhost/base.html.twig to give the CMS its own shell.
Review the SQL for your database copy and follow your application’s schema-change process. Check an existing route and exercise the CMS login before deploying.
php bin/console doctrine:schema:update --dump-sql
php bin/console router:match /account
php bin/console router:match /admin/page
Replace /account with one of your application’s routes. Apply the reviewed schema to your local copy. Create an account with php bin/console pw:user:create. Run php bin/console assets:install --symlink --relative before opening the admin. Installation guide
Choosing between Pushword and Sulu
Start with the model your editors will maintain. Pushword suits a Symfony team that wants Markdown pages with a few typed fields and optionally wants to review the files in Git. Its editors are trusted site authors. Account creation and editing permissions deserve the same care as template access. Pushword security model
Sulu is worth evaluating when a project needs several distinct content models described per template, reusable editorial blocks or publishing rights assigned independently from editing rights. It defines a page layout in Twig and its content fields in XML. Its roles can grant permissions per security context and specific object. Sulu templates · Sulu permissions
Test a page that resembles your own before choosing. If it has an editorial body and fields like the workshop duration, the Pushword starter gives you a place to try that model.