Search by

uxf / page-builder

uxf

UXF Page Builder - CMS page/section versioning system

Package info

gitlab.com/uxf/page-builder

Issues

Type:symfony-bundle

pkg:composer/uxf/page-builder

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

3.87.2 2026-10-30 17:35 UTC

This package is auto-updated.

Last update: 2026-10-30 16:44:49 UTC


README

Symfony bundle for pages built from sections: pages and their revisions, sections and shared sections, publishing and scheduled publishing, previews, the REST API for the backoffice editors and the public read API.

The bundle holds no section types. The project defines them (request class with #[SectionField] attributes, a SectionContentMapper and a response) and registers its layouts, groups and languages in a registry JSON.

Frontend counterparts: @uxf/page-builder (contract), @uxf/page-builder-cms (backoffice editors) and @uxf/page-builder-web (renderer, editor iframe, previews).

Install in a project

composer require uxf/page-builder

The bundle needs uxf/core, uxf/datagrid, symfony/security-bundle and a Symfony security setup that resolves Symfony\Component\Security\Core\User\UserInterface to a concrete user entity (e.g. via uxf/security or uxf/cms).

Setup

Register the bundle in config/bundles.php:

UXF\PageBuilder\UXFPageBuilderBundle::class => ['all' => true],

Import its routes in config/routes.php:

$routingConfigurator->import('@UXFPageBuilderBundle/config/routes.php');

The routes are /api/cms/page-builder/* (editors, admin only) and /api/app/page-builder/* (public read API).

Configuration

$containerConfigurator->extension('uxf_page_builder', [
    // role allowed to publish, unpublish and archive; other admins edit drafts only
    'publisher_role' => 'ROLE_ROOT',
    // TypeScript file `page-builder:schema-gen` writes the section schemas into
    'schema_destination' => '%kernel.project_dir%/../packages/page-builder-project/src/section-schemas.ts',
    // the project's registry JSON (layouts, groups, section types, languages); null = nothing is restricted
    'registry' => '%kernel.project_dir%/config/page-builder/registry.json',
]);

Add the bundle sources to the hydrator map sources, so the section requests and the bundle DTOs share one map:

$containerConfigurator->extension('uxf_hydrator', [
    'map_sources' => [
        __DIR__ . '/../../src',
        __DIR__ . '/../../vendor/uxf/page-builder/src',
    ],
]);

Database

The bundle ships no migrations. Generate them in the project after installing or upgrading the bundle:

bin/console doctrine:migrations:diff
bin/console doctrine:migrations:migrate

Generated clients

The backoffice client comes from the project's uxf_gen hook area. Include the page builder paths in its pattern:

'hook' => [
    'areas' => [
        'admin' => [
            'path_pattern' => '/^\/api\/(app\/page-builder|admin|cms)/',
            'output' => 'swr',
            'destination' => '%kernel.project_dir%/../backoffice/src/generated/api.ts',
        ],
    ],
],

Section schemas for the editors: bin/console page-builder:schema-gen (run it from the project's make gen).

Scheduled publishing

bin/console page-builder:publish-scheduled publishes approved page and shared section revisions whose scheduled time has passed. It carries #[CronJob('* * * * *')] (uxf/cms), an optional integration: when uxf/cms is installed, it lands in the project's crontab once the bundle sources are among the cron sources:

$containerConfigurator->extension('uxf_cms', [
    'cron' => [
        'sources' => [__DIR__ . '/../../src', __DIR__ . '/../../vendor/uxf/page-builder/src'],
        'destinations' => [__DIR__ . '/../../crontab'],
    ],
]);

Then run bin/console uxf:cron-gen and run the crontab with supercronic. The command takes a lock (symfony/lock), so overlapping runs skip.

Without uxf/cms, add the command to the project's crontab by hand instead:

* * * * * bin/console page-builder:publish-scheduled

License

MIT