Your web browser is out of date
Your web browser (the software you use to access the internet) is out of date. You need to update it or use a different web browser to ensure you can complete this form.
WP Blocks
Overview
WordPress plugin that registers ASP Gutenberg blocks using ACF and Timber, and renders them with Frontend Twig macros.
See live examples of the underlying components, and guidance on when to use them, in the ASP Digital Design System.
Features
- Registers blocks under the Avon and Somerset Police block category
- Maps ACF fields into a
$paramsarray that matches the Frontend component API - Renders HTML via Timber Twig macros, or Nunjucks macro calls when
?nunjucks=true(used by design-system content export) - Loads ACF field groups from
acf-json/ - Enqueues Frontend CSS/JS from the CDN when the theme has not already registered them
Available blocks
| Block | Frontend component |
|---|---|
| article-lead | Twig-only fallback |
| acronym | aspAcronym |
| block-list | aspSignage |
| card-list | aspCard |
| page-list | aspSignage |
| care-card | aspAction |
| contact-box | Twig-only fallback |
| cookie-settings | Cookie settings UI |
| details | aspAccordion |
| do-dont | aspNotification |
| hero | aspHero |
| info-box | aspNotification |
| search | aspSearchInput (HTML only; not exported) |
| steps | aspSteps |
| summary-list | aspSummaryList |
| table | aspTable |
Requirements
- WordPress 7.0+
- PHP 8.2+
- Composer
- Advanced Custom Fields Pro
- Timber 2 via Composer (
timber/timber) policedigitalservices/asp-frontendvia Composer
The plugin looks for Composer packages in the WordPress root vendor/, the parent vendor/, then its own vendor/ directory.
Installation
Clone or place the plugin under wp-content/plugins/, then install dependencies from the WordPress project root (or the plugin directory if you maintain a local vendor tree):
git clone https://github.com/policedigitalservices/asp-wp-blocks.git
cd asp-wp-blocks
composer install
Activate WP Blocks and Advanced Custom Fields Pro in the WordPress admin. If ACF, Timber, or ASP Frontend are missing, the plugin shows an admin notice and exits early.
Configuration
When ASP_CDN_URL and ASP_CDN_VERSION are defined, the plugin enqueues Frontend CSS/JS only if the theme has not already registered them. Editor canvas styles are loaded with add_editor_style() so they apply inside the writing iframe.
Block scripts (for example cookie-bar.js, toggle-button.js, table.js) are filterable via asp_blocks_frontend_scripts.
Hosting
Runs in consuming WordPress sites.
Tech stack
- PHP
- WordPress / Gutenberg
- ACF Pro
- Timber 2
- ASP Frontend (Twig / Nunjucks)
Used by
- ASP Digital (content export into the design system)
- WordPress products and microsites that use ASP Gutenberg blocks
Integrations
In house applications
Force IT
> TODO: Add content.
Third party
- Advanced Custom Fields Pro
- Timber
Contacts
- Christian King -- Development Team Lead
Repositories
Resources
> TODO: Add backlog, board, or related docs.
Published 21 September 2026
Last updated 21 September 2026