Setup for WordPress - Block Editor (Gutenberg)
Prerequisites
- Composer installed on your machine
- WordPress site installed and running locally
- Advanced Custom Fields Pro installed and active on your local site.
Package details
Comet Components plugin Essential
The Comet Components plugin provides:
- implementations of WordPress core blocks listed in its
block-support.jsonfile, as Comet Component versions - additional blocks and variations that correspond to selected Comet components such as
Container,Call-to-Action,Callout,FileGroup,Accordion, andTabs - support for using Comet Components for reusable blocks (synced patterns), such as a call-to-action used in multiple places on a site.
Comet Components blocks utilise core blocks and options where practical, but some blocks do use ACF Pro where it provides a better user experience.
Comet Canvas theme Essential
The Comet Canvas theme is designed to be used as a parent theme and provides:
- Common navigation menu configuration
- Implementations of Comet's
SiteHeader,PageHeader, andSiteFootercomponents (with relevant inner components likeMenuandBreadcrumbs) in the relevant files as per the WordPress template hierarchy - Injection of theme colours from
theme.jsonas embedded CSS variables in the<head> - Enqueueing of theme
style.cssfiles in the block editor and front-end - Site Health checks for required and recommended plugins.
Comet Calendar plugin Optional
The Comet Calendar provides custom post types, taxonomies, templates, and blocks for managing and displaying event information using Comet Components on the front-end.
Installation
The easiest way to install the Comet Components plugin and its dependencies is to use Composer with the belowcomposer.json configuration.
Add this file in your project root (the same level as the
wp-contentdirectory), or update your existingcomposer.jsonif you have one:{ "name": "your-project-name", "description": "Custom WordPress site", "type": "project", "private": true, "minimum-stability": "dev", "prefer-stable": true, "require": { "php": "^8.3", "doubleedesign/comet-calendar": "dev-master", "doubleedesign/comet-plugin-blocks": "dev-master", "doubleedesign/comet-canvas-blocks": "dev-master", "composer/installers": "^2.0", "doubleedesign/doublee-base-plugin": "dev-master", "doubleedesign/doublee-breadcrumbs": "dev-main", "doubleedesign/doublee-tinymce": "dev-main", "doubleedesign/acf-advanced-image-field": "dev-main" }, "config": { "allow-plugins": { "composer/installers": true }, "preferred-install": { "doubleedesign/comet-components-core": "dist" } }, "repositories": [ { "type": "vcs", "url": "https://github.com/doubleedesign/baguetteBox.js" } ], "extra": { "installer-paths": { "wp-content/plugins/{$name}/": [ "type:wordpress-plugin", "doubleedesign/comet-calendar", "doubleedesign/comet-plugin-blocks", "doubleedesign/doublee-base-plugin", "doubleedesign/doublee-breadcrumbs", "doubleedesign/doublee-tinymce", "doubleedesign/acf-advanced-image-field" ], "wp-content/themes/{$name}/": [ "type:wordpress-theme", "doubleedesign/comet-canvas-blocks" ] }, "resolve-dependencies": false } }To install the plugins and theme, run the following command in your terminal:
composer installOr if you're updating an existing installation:
composer updateIt is then recommended to
cdinto each directory and ensure the autoloaders are up to date:composer dump-autoload -oThe theme, and Calendar plugin are configured to look for the core library and its dependencies in the main (
comet-plugin) plugin'svendordirectory. To install the dependencies,cdto thecomet-plugin-blocksdirectory and run:composer install
Tips
Steps 3 and 4 (refreshing autoloading and installing dependencies in the plugin) can be consolidated into a single PowerShell script calledcomposer-postinstall.ps1 placed in your project root.
Streamline steps 3 and 4 with a PowerShell script
# composer-postinstall.ps1
Write-Host "Starting Composer refresh script"
composer clear-cache
function Run-Composer
{
param (
[string]$directory
)
Write-Host "Running composer commands in $directory"
Push-Location $directory
composer install
composer dump-autoload -o
Pop-Location
}
# Directories to run composer commands in
$directories = @(
"wp-content/plugins/comet-plugin",
"wp-content/plugins/comet-calendar",
"wp-content/themes/comet-canvas"
)
# Save root directory
$ROOT_DIR = Get-Location
# Run composer commands in each directory
foreach ($directory in $directories)
{
$fullPath = Join-Path $ROOT_DIR $directory
if (Test-Path $fullPath)
{
Run-Composer $fullPath
}
else
{
Write-Host "Directory $fullPath does not exist. Skipping."
}
}
Write-Host "Composer postinstall refresh done."
Run it with:
.\composer-postinstall.ps1
What's included
The above Composer configuration installs the below:
Comet essentials
Other plugins
- Double-E Breadcrumbs plugin - the Comet themes and plugins are configured to work with this for breadcrumbs in the PageHeader component.
- Double-E Design Base Plugin - provides site "Global Options", some admin customisations, user role customisations, and other features and customisations commonly used for Double-E Design websites.
- Double-E TinyMCE - provides customised configurations and plugins for TinyMCE fields and the Classic Editor. Plugins include the ability to add a button group, callout, pullquote, or table to TinyMCE-driven content fields. Highly recommended for the as-intended content editing experience.
- Advanced Image Field for ACF by Double-E Design - Comet's flexible content modules are designed to utilise this plugin for enhanced image field functionality, including aspect ratio and focal point cropping options.
Troubleshooting
Latest version not installing
- Delete the folder of the plugin or theme you are trying to update
- Run
composer clear-cache - Run
composer update --prefer-source - Run
composer-postinstall.ps1or equivalent commands as detailed above.
