GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bcgov/bcgov-wordpress-block-theme: BCGov WordPress Block Theme

BranchesTags
Open more actions menu

Latest commit

 

History

610 Commits
610 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
Tests
Tests
 
 
assets
assets
 
 
dist
dist
 
 
documentation
documentation
 
 
inc/core
inc/core
 
 
parts
parts
 
 
src
src
 
 
styles
styles
 
 
templates
templates
 
 
.eslint.js
.eslint.js
 
 
.eslintignore
.eslintignore
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.markdownlintignore
.markdownlintignore
 
 
.npmrc
.npmrc
 
 
.prettierrc.js
.prettierrc.js
 
 
.stylelintrc
.stylelintrc
 
 
CHANGELOG.md
CHANGELOG.md
 
 
COMPLIANCE.yaml
COMPLIANCE.yaml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
checklist.md
checklist.md
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 
functions.php
functions.php
 
 
index.php
index.php
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
phpunit.xml
phpunit.xml
 
 
screenshot.png
screenshot.png
 
 
style.css
style.css
 
 
theme.json
theme.json
 
 

Repository files navigation

BCGov WordPress Block Theme

Lifecycle:Experimental

Development Setup

git clone https://github.com/bcgov/bcgov-wordpress-block-theme.git
cd bcgov-wordpress-block-theme
composer install
npm i
npm run start

Build

  • npm run build:production
  • composer checklist

Managing embedded sites

v1.0.0

The BCGov Block Theme has been developed with the initial strategy to include sites that utilise it as features of the default installation. In previous versions of WordPress the base theme was developed and then forked to create site specific themes. With the advent of Full Site Editing and Block Themes in WordPress 6 and up, the decision was made to offer the various styles and design features of sites that use it in an onging way to enhance the experience for future site owners.

This adds some housekeeping for the theme developers, which include touchpoints within the code for implementing features such as Templates, Block Styles and variations, Block Patterns, Custom Post Types and more. Here is the current breakdown of where these features are managed. Expect this information to be updated as the site and WordPress itself matures around Full Site Editing using Block Themes.

Site constants

Where: functions.php

To turn off and on certain features, PHP constants are defined in the functions file. The following examples will use the CleanBC project constants which are defined as CleanBC.

The \Bcgov\Theme\Block\OPTIONAL constant is used in the following locations:

  • Set in Setup.php
  • Used for allowing site specific patterns: inc/core/theme-block-patterns.php

This can be done using the check:

if ( \Bcgov\Theme\Block\OPTIONAL ) {

To enable/disable Javascript based features such as Block Filters, a global Javascript variable is set to allow for checking whether the site is avaiable. Add additional/new site checks to the set_javascript_variables() function:

/src/Setup.php –> set_javascript_variables()

An example of the check can be done in any JS file using the window scope and can be found in: button-enhanced.js :

if ('optional' === window.site.siteName || window.site.allSiteStyles.length) {

The window.site.allSiteStyles array length check is used to determine if the admin has enabled access to site styles or features that are not specifically used by the site settings they chose. For example if they admin selects Buy BC styling but also chooses 'Enable all styles' in the theme options, this check will allow this code block to run.

Site Specific Custom Post Types (CPT)

Use the 'Custom Post Type UI' (CPT UI) in conjunction with the 'Advanced Custom Fields Pro' (ACF Pro) plugins to generate new Custom Post Types.

Site Specific Block Patterns

Where: /inc/core/theme-block-patterns.php

When registering new Block Paterns use the [SITE] constant check. Eg:

if ( \Bcgov\Theme\Block\OPTIONAL ) {

Add any site specific patterns to the $block_patterns array. The reasoning for this using a pattern specific check is that while Custom Post Types, taxonomies, block filters and more may need to be suppressed for a site, the patterns developed for previous sites can be left available to site owners for use in page building and rapid prototyping layouts.

Printing features

as of v1.0.5

Classes to hide elements when printing (use any of the following):

.do-not-print
.hide-for-print
.hide-when-printing

Admin User Documentation

Added to the site admin under Appearance > BCGov Block Theme and can be modified in:

/inc/core/templates/theme-info-page.php

About

BCGov WordPress Block Theme

bcgov.github.io/bcgov-wordpress-block-theme/

Topics

bcgovcitzgutenberg-blocksgutenberg-themewordpresswordpress-theme

Resources

Readme
Apache-2.0 license
Activity
Custom properties

Stars

5 stars

Watchers

7 watching

Forks

5 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.