Skip to content

Installation & Requirements

Requirement Version
PHP >= 8.4
ProcessWire >= 3.0.271
Required Modules Inertia (trk/processwire-inertia), React (trk/processwire-react), Entries (trk/processwire-entries)
Optional CLI trk/processwire-console (vendor/bin/wire) for make:block and blocks:doctor
  1. Require the package from your project root:

    Terminal window
    composer require trk/processwire-blocks
  2. Refresh and install Blocks:

    Terminal window
    php vendor/bin/wire module:refresh
    php vendor/bin/wire module:install --name=Blocks

Installing Blocks automatically installs ProcessBlocks (Setup -> Blocks), FieldtypeBlocks (BlocksField), and InputfieldBlocks, creates the blocks and blocks-admin RBAC permissions, and registers the Blocks workspace and Bento overview widget inside React.

  1. Attach the blocks field to a template

    Add a FieldtypeBlocks field to any template under Setup -> Fields (choosing the Blocks: Visual Studio setup preset), or provision it programmatically:

    <?php
    declare(strict_types=1);
    namespace ProcessWire;
    $blocks = Blocks::requireInstance($this);
    $blocks->layouts()->ensureBlocksFieldOnTemplate('basic-page', 'blocks');
  2. Scaffold your first block & run health diagnostics

    Terminal window
    php vendor/bin/wire make:block feature_banner --category=Marketing --icon=speakerphone --php-view
    php vendor/bin/wire blocks:doctor --json

Next steps