Installation & Requirements
Requirements
Section titled “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 |
Installation Steps
Section titled “Installation Steps”-
Require the package from your project root:
Terminal window composer require trk/processwire-blocks -
Refresh and install
Blocks:Terminal window php vendor/bin/wire module:refreshphp vendor/bin/wire module:install --name=Blocks
- Log in as a superuser and navigate to Modules -> New.
- Use Add Module from Directory (enter
Blocks), Add Module from URL, or Add Module from Upload (ZIP archive). - Click Modules -> Refresh, locate Blocks under the Site tab, and click Install.
- Download and extract the release archive into
site/modules/Blocks/. - Open Modules -> Refresh in the ProcessWire admin (or run
php vendor/bin/wire module:refresh). - Click Install next to Blocks under Modules -> Site.
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.
Post-Install Setup
Section titled “Post-Install Setup”-
Attach the
blocksfield to a templateAdd a
FieldtypeBlocksfield to any template under Setup -> Fields (choosing the Blocks: Visual Studio setup preset), or provision it programmatically:<?phpdeclare(strict_types=1);namespace ProcessWire;$blocks = Blocks::requireInstance($this);$blocks->layouts()->ensureBlocksFieldOnTemplate('basic-page', 'blocks'); -
Scaffold your first block & run health diagnostics
Terminal window php vendor/bin/wire make:block feature_banner --category=Marketing --icon=speakerphone --php-viewphp vendor/bin/wire blocks:doctor --json