• Stars
    star
    279
  • Rank 147,967 (Top 3 %)
  • Language
    PHP
  • Created over 5 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Bootstrap Gutenberg Blocks for WordPress

Bootstrap Gutenberg Blocks for WordPress

Build Status

Bootstrap Gutenberg Blocks for WordPress. This plugin adds Bootstrap components and layout options as Gutenberg blocks.

Features

  • Supports Bootstrap v5 and v4
  • Support for CSS grid (experimental)
  • Fully customizable with filters
  • Configuration via option page or programmatically with constants
  • Block templates can be overwritten in your theme

Available blocks

Container

Options

  • Fluid: If enabled the container will use the full available width, spanning the entire width of the viewport.
  • Fluid Breakpoint: Used to enable responsive containers. This feature only works with Bootstrap v4.4+. The container will use 100% of the width until the specified breakpoint is reached, after which the defined max-widths will apply for each of the higher breakpoints.
  • Margin After: Define a margin which should be added after the container.

Row

Options

  • Template: Choose from a predefined template for the inner column blocks.
  • No Gutters: Disable gutters between columns.
  • Alignment: Horizontal alignment of inner column blocks.
  • Vertical Alignment: Vertical alignment of inner column blocks.
  • Editor stack columns: Displays stacked columns in the editor to enhance readability of block content.
  • Horizontal Gutters: Size of horizontal gutters.
  • Vertical Gutters: Size of vertical gutters.
  • CSS Grid Gutters: Size of gutters when CSS grid is used.

Column

Options

  • Sizes for all breakpoints (xxl, xl, lg, md, sm, xs): How much space the column should use for the given breakpoint.
  • Equal width for all breakpoints (xxl, xl, lg, md, sm, xs): If enabled column will spread width evenly with other columns.
  • Background Color: Set background color to column.
  • Content vertical alignment: Align content vertically in column. This option is only needed if a background color is set. Otherwise use the Alignment option of the outer row block.
  • Padding: Define padding inside the column.

Button

Options

  • Style: Choose the styling of the button.
  • Open in new tab: Choose if link should be opened in a new tab.
  • Rel: Set rel attribute of the link.
  • Alignment: Horizontal alignment of the button.

Further Information

Supported Bootstrap versions

This plugin supports Bootstrap v4 and v5.

The version can be selected in the plugin settings (Settings > Bootstrap Blocks) or by defining the WP_BOOTSTRAP_BLOCKS_BOOTSTRAP_VERSION constant in the wp-config.php file:

  • Bootstrap 4 (default): define( 'WP_BOOTSTRAP_BLOCKS_BOOTSTRAP_VERSION', '4' );
  • Bootstrap 5: define( 'WP_BOOTSTRAP_BLOCKS_BOOTSTRAP_VERSION', '5' );

Possible values right now are '4' or '5'. By default Bootstrap version 5 is selected.

CSS Grid

The CSS grid (supported with Bootstrap >= 5.1.0) can be enabled in the plugin settings (Settings > Bootstrap Blocks) or by defining the WP_BOOTSTRAP_BLOCKS_ENABLE_CSS_GRID constant in the wp-config.php file:

eg. define( 'WP_BOOTSTRAP_BLOCKS_ENABLE_CSS_GRID', true );

When the CSS grid is enabled the row and the column blocks will use custom templates for the rendering process:

  • Row: row-css.grid.php
  • Column: column-css-grid.php

The support is still experimental since it's also marked as experimental in the Bootstarp library. Please read the official Bootstrap documentation to get more information on how to use it.

Bootstrap library

Please be aware that this plugin does not include the Bootstrap library in your website. You need to do this by yourself. We decided not to include the library so that you can modify Bootstrap to your own needs before loading it.

The easiest way to do this is to add the following to your theme's functions.php:

function mytheme_load_bootstrap() {
    if ( is_admin() ) {
        return;
    }

    wp_enqueue_style( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css', array(), '4.3.1' );
    wp_deregister_script( 'jquery' ); // Remove WP jQuery version
    wp_enqueue_script( 'jquery', 'https://code.jquery.com/jquery-3.3.1.slim.min.js', array(), '3.3.1', true );
    wp_enqueue_script( 'popper.js', 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js', array(), '1.14.7', true );
    wp_enqueue_script( 'bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js', array(), '4.3.1', true );
}
add_action( 'wp_enqueue_scripts', 'mytheme_load_bootstrap' );

Templates

All blocks are implemented as dynamic blocks. This makes it possible to overwrite the template of a block in your theme.

To overwrite a block template create a folder called wp-bootstrap-blocks/ in your theme directory. You can copy the original template from wp-bootstrap-blocks/src/templates/<blockname>.php as a starting point and adjust it to your needs.

PHP Filters

The plugin provides the following PHP filters. Please visit the following page to get more information about PHP filters: https://developer.wordpress.org/reference/functions/add_filter/.

wp_bootstrap_blocks_template_path

Changes the default theme directory name (wp-bootstrap-blocks/).

Usage

add_filter( 'wp_bootstrap_blocks_template_path', 'my_template_path', 10, 1 );

function my_template_path( $template_path ) {
    return 'block-templates/';
}

Parameters

  • $template_path (string) Template directory name in theme. (Default: 'wp-bootstrap-blocks/')

wp_bootstrap_blocks_get_template

Possibility to overwrite the located template path before it gets loaded.

Parameters

  • $located (string) located file path.
  • $template_name (string) template name which was requested.
  • $template_path (string) path to template directory.
  • $default_path (string) default template directory path.

Usage

add_filter( 'wp_bootstrap_blocks_get_template', 'my_located_template', 10, 4 );

function my_located_template( $located, $template_name, $template_path, $default_path ) {
    return 'mytheme/special-templates/block.php';
}

wp_bootstrap_blocks_locate_template

Possibility to overwrite the located template path.

Parameters

  • $template (string) located file path.
  • $template_name (string) template name which was requested.
  • $template_path (string) path to template directory.

Usage

add_filter( 'wp_bootstrap_blocks_locate_template', 'my_template_locater', 10, 3 );

function my_template_locater( $template, $template_name, $template_path ) {
    return 'mytheme/special-templates/block.php';
}

wp_bootstrap_blocks_row_classes

Change classes of row block.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_row_classes', 'my_custom_row_classes', 10, 2 );

function my_custom_row_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_row_css_grid_classes

Change classes of row block when CSS grid is enabled.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_row_css_grid_classes', 'my_custom_row_css_grid_classes', 10, 2 );

function my_custom_row_css_grid_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_row_css_grid_styles

Change inline styles of row block when CSS grid is enabled.

Parameters

  • $styles (string) Inline styles which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_row_css_grid_styles', 'my_custom_row_css_grid_styles', 10, 2 );

function my_custom_row_css_grid_styles( $styles, $attributes ) {
    return '--bs-gap: 3rem;';
}

wp_bootstrap_blocks_column_classes

Change classes of column block.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_column_classes', 'my_custom_column_classes', 10, 2 );

function my_custom_column_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_column_css_grid_classes

Change classes of column block when CSS grid is enabled.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_column_css_grid_classes', 'my_custom_column_css_grid_classes', 10, 2 );

function my_custom_column_css_grid_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_column_content_classes

Change classes of the inner content of the column block.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_column_content_classes', 'my_custom_column_content_classes', 10, 2 );

function my_custom_column_content_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_column_css_grid_content_classes

Change classes of the inner content of the column block when CSS grid is enabled.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_column_css_grid_content_classes', 'my_custom_column_css_grid_content_classes', 10, 2 );

function my_custom_column_css_grid_content_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_container_classes

Change classes of container block.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_container_classes', 'my_custom_container_classes', 10, 2 );

function my_custom_container_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_button_classes

Change classes of button block.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_button_classes', 'my_custom_button_classes', 10, 2 );

function my_custom_button_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_button_wrapper_classes

Change classes of button block wrapper.

Parameters

  • $classes (array) Classes which are added to the block template.
  • $attributes (array) Attributes of the block.

Usage

add_filter( 'wp_bootstrap_blocks_button_wrapper_classes', 'my_custom_button_wrapper_classes', 10, 2 );

function my_custom_button_wrapper_classes( $classes, $attributes ) {
    return [ 'my', 'custom', 'classes' ];
}

wp_bootstrap_blocks_row_default_attributes

Modify default attributes of the row block.

Parameters

  • $default_attributes (array) Default attributes of row block.
    • template (string) Name of default template of row block (Default: '1-1')
    • noGutters (boolean) Defines if noGutters option should be selected or not (Default: false)
    • alignment ('left' | 'center' | 'right') Default horizontal alignment of inner columns (Default: '')
    • verticalAlignment ('top' | 'center' | 'bottom') Default vertical alignment of inner columns (Default: '')
    • editorStackColumns (boolean) Defines if editorStackColumns option should be selected by default or not (Default: false)
    • horizontalGutters (string) Default horizontal gutters size (Default: '')
    • verticalGutters (string) Default vertical gutters size (Default: '')
    • cssGridGutters (string) Default gutters size when CSS grid is enabled (Default: '')

Usage

add_filter( 'wp_bootstrap_blocks_row_default_attributes', 'my_row_default_attributes', 10, 1 );

function my_row_default_attributes( $default_attributes ) {
    $default_attributes['template'] = '1-2';
    $default_attributes['noGutters'] = true;
    $default_attributes['alignment'] = 'right';
    $default_attributes['verticalAlignment'] = 'bottom';
    $default_attributes['editorStackColumns'] = true;
    $default_attributes['horizontalGutters'] = 'gx-5';
    $default_attributes['verticalGutters'] = 'gy-3';
    return $default_attributes;
}

wp_bootstrap_blocks_column_default_attributes

Modify default attributes of the column block.

Parameters

  • $default_attributes (array) Default attributes of column block.
    • sizeXxl (int) Default xxl column size (Default: 0)
    • sizeXl (int) Default xl column size (Default: 0)
    • sizeLg (int) Default lg column size (Default: 0)
    • sizeMd (int) Default md column size (Default: 0)
    • sizeSm (int) Default sm column size (Default: 0)
    • sizeXs (int) Default xs column size (Default: 12))
    • equalWidthXxl (boolean) Defines if equal-width xxl option should be selected or not (Default: false)
    • equalWidthXl (boolean) Defines if equal-width xl option should be selected or not (Default: false)
    • equalWidthLg (boolean) Defines if equal-width lg option should be selected or not (Default: false)
    • equalWidthMd (boolean) Defines if equal-width md option should be selected or not (Default: false)
    • equalWidthSm (boolean) Defines if equal-width sm option should be selected or not (Default: false)
    • equalWidthXs (boolean) Defines if equal-width xs option should be selected or not (Default: false)
    • bgColor (string) Background color of column (Default: '')
    • contentVerticalAlignment ('top' | 'center' | 'bottom') Default vertical alignment of content (Default: '')
    • padding (string) Padding inside column (Default: '')

Usage

add_filter( 'wp_bootstrap_blocks_column_default_attributes', 'my_column_default_attributes', 10, 1 );

function my_column_default_attributes( $default_attributes ) {
    $default_attributes['sizeLg'] = 4;
    $default_attributes['sizeMd'] = 6;
    $default_attributes['equalWidthXl'] = true;
    $default_attributes['bgColor'] = 'primary';
    $default_attributes['padding'] = 'p-3';
    $default_attributes['contentVerticalAlignment'] = 'bottom';
    return $default_attributes;
}

wp_bootstrap_blocks_container_default_attributes

Modify default attributes of the container block.

Parameters

  • $default_attributes (array) Default attributes of container block.
    • isFluid (boolean) Defines if container should be fluid or not (Default: false)
    • marginAfter (string) Default margin after container block (Default: 'mb-2')

Usage

add_filter( 'wp_bootstrap_blocks_container_default_attributes', 'my_container_default_attributes', 10, 1 );

function my_container_default_attributes( $default_attributes ) {
    $default_attributes['isFluid'] = true;
    $default_attributes['fluidBreakpoint'] = 'md';
    $default_attributes['marginAfter'] = 'mb-3';
    return $default_attributes;
}

wp_bootstrap_blocks_button_default_attributes

Modify default attributes of the button block.

Parameters

  • $default_attributes (array) Default attributes of button block.
    • url (string) Default url of the button (Default: '')
    • linkTarget (string) Default link target (Default: ''). Possible values:
      • '': Target attribute empty
      • _blank: Target attribute is set to _blank
    • rel (string) Default rel attribute of the link (Default: '')
    • text (string) Default text of the button (Default: '')
    • style (string) Default style of the button (Default: 'primary')
    • alignment (string) Default alignment of the button (Default: '')

Usage

add_filter( 'wp_bootstrap_blocks_button_default_attributes', 'my_button_default_attributes', 10, 1 );

function my_button_default_attributes( $default_attributes ) {
    $default_attributes['url'] = 'https://getbootstrap.com/';
    $default_attributes['linkTarget'] = '_blank';
    $default_attributes['rel'] = 'noreferrer noopener';
    $default_attributes['text'] = 'Bootstrap';
    $default_attributes['style'] = 'secondary';
    $default_attributes['alignment'] = 'right';
    return $default_attributes;
}

wp_bootstrap_blocks_enqueue_block_assets

Possibility to disable enqueuing block assets.

Parameters

  • $enqueue_block_assets (boolean) Defines if block assets should be enqueued. (Default: true)

Usage

add_filter( 'wp_bootstrap_blocks_enqueue_block_assets', 'disable_enqueue_block_assets', 10, 1 );

function disable_enqueue_block_assets( $enqueue_block_assets ) {
    // Disable enqueuing block assets
    return false;
}

PHP Actions

wp-bootstrap-blocks_updated

Fires when a new version of the plugin is used for the first time.

Parameters

  • $new_version (string) New version number.
  • $old_version (string) Old version number.

Usage

add_action( 'wp-bootstrap-blocks_updated', 'my_after_plugin_update', 10, 2 );

function my_after_plugin_update( $new_version, $old_version ) {
    echo "wp-bootstrap-blocks got updated from v" . $old_version . " to v" . $new_version;
}

JavaScript Filters

The plugin provides the following JavaScript filters. They can be used by enqueuing a custom JavaScript file which implements those filters.

Example:

If you have a script called block-filters.js inside your theme root you can enqueue it by adding the following code to your functions.php file.

function mytheme_enqueue_block_editor_assets() {
	wp_enqueue_script( 'block-filters', get_stylesheet_directory_uri() . '/block-filters.js', array( 'wp-hooks' ), '1.0.0', true );
}
add_action( 'enqueue_block_editor_assets', 'mytheme_enqueue_block_editor_assets' );

Please visit the following page to get further instructions on how to use JavaScript filters: https://developer.wordpress.org/block-editor/developers/filters/block-filters/.

wpBootstrapBlocks.button.styleOptions

Modify available button styles.

Usage

function myButtonStyleOptions( styleOptions ) {
	styleOptions.push( {
		label: 'My Option',
		value: 'my-option',
		bgColor: '#ff0000',
		textColor: '#ffffff',
	} );
	return styleOptions;
}
wp.hooks.addFilter(
	'wpBootstrapBlocks.button.styleOptions',
	'myplugin/wp-bootstrap-blocks/button/styleOptions',
	myButtonStyleOptions
);

Parameters

  • styleOptions (Array) Array with button style options.

Each styleOption object should have the following attributes:

  • label (string) Label displayed in the select box.
  • value (string) Value of the chosen option.
  • bgColor (string) Background color of button shown in the editor.
  • textColor (string) Text color of button shown in the editor.

wpBootstrapBlocks.container.marginAfterOptions

Modify margin after options.

Usage

function myMarginAfterOptions( marginAfterOptions ) {
	marginAfterOptions.push( { label: 'Huge', value: 'mb-8' } );
	return marginAfterOptions;
}
wp.hooks.addFilter(
	'wpBootstrapBlocks.container.marginAfterOptions',
	'myplugin/wp-bootstrap-blocks/container/marginAfterOptions',
	myMarginAfterOptions
);

Parameters

  • marginAfterOptions (Array) Array margin options.

Each marginAfterOption object should have the following attributes:

  • label (string) Label displayed in the select box.
  • value (string) Value of the chosen option.

wpBootstrapBlocks.row.templates

Define block templates.

Usage

function myRowTemplates( templates ) {
	templates.push( {
		name: '1-3',
		title: '2 Columns (1:3)',
		icon: 'layout',
		templateLock: 'all',
		template: [
			[
				'wp-bootstrap-blocks/column',
				{
					sizeMd: 3,
				},
			],
			[
				'wp-bootstrap-blocks/column',
				{
					sizeMd: 9,
				},
			],
		],
	} );
	return templates;
}
wp.hooks.addFilter(
	'wpBootstrapBlocks.row.templates',
	'myplugin/wp-bootstrap-blocks/row/templates',
	myRowTemplates
);

Parameters

  • templates (array) List of template objects.

Each template object should have the following attributes:

  • name (string) Unique identifier of the template
  • title (string) Name of template
  • icon (WPElement|string) An element or Dashicon slug to show as a visual approximation of the template.
  • templateLock (string|false)
    • false: Columns can be added and removed
    • all: Columns can't be changed
  • template (Array<Array>) see template documentation
    • Name of block. (Only wp-bootstrap-blocks/column supported!)
    • Attributes of column

wpBootstrapBlocks.row.enableCustomTemplate

Enable/Disable custom option in row templates.

Usage

// Disable custom row template
wp.hooks.addFilter(
	'wpBootstrapBlocks.row.enableCustomTemplate',
	'myplugin/wp-bootstrap-blocks/row/enableCustomTemplate',
	() => false
);

Parameters

  • enableCustomTemplate (boolean) Return true if custom row template should be enabled. (Default: true)

wpBootstrapBlocks.row.horizontalGuttersOptions

Modify available horizontal gutters options for row block.

Usage

function myRowHorizontalGuttersOptions( horizontalGuttersOptions ) {
	horizontalGuttersOptions.push( { label: 'Medium', value: 'gx-4' } );
	return horizontalGuttersOptions;
}
wp.hooks.addFilter(
	'wpBootstrapBlocks.row.horizontalGuttersOptions',
	'myplugin/wp-bootstrap-blocks/row/horizontalGuttersOptions',
	myRowHorizontalGuttersOptions
);

Parameters

  • horizontalGuttersOptions (Array) Array of horizontal gutters options.

wpBootstrapBlocks.row.verticalGuttersOptions

Modify available vertical gutters options for row block.

Usage

function myRowVerticalGuttersOptions( verticalGuttersOptions ) {
	verticalGuttersOptions.push( { label: 'Medium', value: 'gy-4' } );
	return verticalGuttersOptions;
}
wp.hooks.addFilter(
	'wpBootstrapBlocks.row.verticalGuttersOptions',
	'myplugin/wp-bootstrap-blocks/row/verticalGuttersOptions',
	myRowVerticalGuttersOptions
);

Parameters

  • verticalGuttersOptions (Array) Array of vertical gutters options.

wpBootstrapBlocks.row.cssGridGuttersOptions

Modify available CSS grid gutters options for row block.

Usage

function myRowCssGridGuttersOptions( cssGridGuttersOptions ) {
	cssGridGuttersOptions.push( { label: 'Medium', value: '1.5rem' } );
	return cssGridGuttersOptions;
}
wp.hooks.addFilter(
	'wpBootstrapBlocks.row.cssGridGuttersOptions',
	'myplugin/wp-bootstrap-blocks/row/cssGridGuttersOptions',
	myRowCssGridGuttersOptions
);

Parameters

  • cssGridGuttersOptions (Array) Array of CSS grid gutters options.

wpBootstrapBlocks.column.bgColors

Modify available background colors for column block.

Usage

function myColumnBgColorOptions( bgColorOptions ) {
	bgColorOptions.push( {
		name: 'brand',
		color: '#6EA644',
	} );
	return bgColorOptions;
}
wp.hooks.addFilter(
	'wpBootstrapBlocks.column.bgColorOptions',
	'myplugin/wp-bootstrap-blocks/column/bgColorOptions',
	myColumnBgColorOptions
);

Parameters

wpBootstrapBlocks.column.paddingOptions

Modify available padding options for column block.

Usage

function myColumnPaddingOptions( paddingOptions ) {
	paddingOptions.push( { label: 'Huge', value: 'p-8' } );
	return paddingOptions;
}
wp.hooks.addFilter(
	'wpBootstrapBlocks.column.paddingOptions',
	'myplugin/wp-bootstrap-blocks/column/paddingOptions',
	myColumnPaddingOptions
);

Parameters

  • paddingOptions (Array) Array of padding options.

Developer information

Requirements

  • Node.js >= 16.x
  • Docker

Installation

  1. Clone this repository

  2. Install composer dependencies

    curl -s https://getcomposer.org/installer | php
    php composer.phar install
  3. Install Node dependencies

    npm install

Compile assets

The build process is based on the official @wordpress/scripts package.

  • npm start: Compiles the block in development mode. Watches for any changes and reports back any errors in your code.
  • npm run lint: Lints JavaScript, CSS and package.json files.
  • npm run build: Build production code of your blocks inside build folder.

Generate translation files

  1. To extract the labels and generate the languages/wp-bootstrap-blocks.pot file run the following command:

    ./scripts/translations/extract-messages.sh
  2. To update the translation files (*.po) run the following command:

    ./scripts/translations/update-translation-files.sh
  3. To generate the *.mo and *.json translation files run the following command:

    ./scripts/translations/compile-translation-files.sh

Setup local dev environment

The following commands can be used to set up a local dev environment. See the official documentation of @wordpress/env for a complete list of commands.

  • npm run wp-env start: Starts the Docker containers.
  • npm run wp-env stop: Stops the Docker containers.

Testing

There are two types of tests for this plugin:

  • PHPUnit Tests: Used to validate generated block output. Since this plugin uses dynamic blocks which are rendered on the server side we need to test them with PHPUnit tests.
  • Cypress E2E Tests: Used to validate block behaviour in the editor.

PHPUnitTests

The PHPUnit tests are stored in the phpunit/ directory. They use fixtures to validate the block output. Each block variant which should be tested needs a manually created file called blockname__variant.html. This file contains the block presentation in the editor (a.k.a. the HTML comment presentation) and needs to be stored in the following folder:

phpunit/blockname/fixtures/blockname_variant.html

The second fixture of each variant is the blockname_variant.output.html file. This file gets automatically generated if the test runs for the first time and the environment variable WP_BOOTSTRAP_BLOCKS_RECORD in the phpunit.xml.dist file is set to true.

To run the tests use the following command:

npm run test:unit:php

or the following command to run a specific test:

npm run test:unit:php -- --filter 'my_test'

Cypress E2E Tests

The Cypress E2E Tests are stored in the cypress directory.

To run the tests use the following command:

npm run test:e2e

More Repositories

1

LiipImagineBundle

Symfony Bundle to assist in image manipulation using the imagine library
PHP
1,661
star
2

LiipFunctionalTestBundle

Some helper classes for writing functional tests in Symfony
PHP
639
star
3

TheA11yMachine

The A11y Machine is an automated accessibility testing tool which crawls and tests pages of any web application to produce detailed reports.
JavaScript
620
star
4

LiipMonitorBundle

Integrates the LiipMonitor library into Symfony
PHP
469
star
5

RMT

RMT is a handy tool to help releasing new version of your software
PHP
451
star
6

php-osx

DEPRECATED: See https://php-osx.liip.ch/ for details. The uploader and website for the PHP 5 package for OS X 10.6 built with https://github.com/liip/build-entropy-php
PHP
329
star
7

LiipThemeBundle

Provides theming support for Symfony bundles
PHP
291
star
8

sheriff

Conditional marshalling for Go
Go
244
star
9

LiipHelloBundle

[DEPRECATED] Alternative Hello World Bundle for Symfony2 using several FriendsOfSymfony Bundles
PHP
201
star
10

LiipTestFixturesBundle

This bundles enables efficient loading of Doctrine fixtures in functional test-cases for Symfony applications
PHP
165
star
11

serializer

A PHP serializer that generates PHP code for maximum performance
PHP
128
star
12

LiipCacheControlBundle

DEPRECATED! This bundle is superseded by FOSHttpCacheBundle. A migration guide is in the README of LiipCacheControlBundle
PHP
108
star
13

kanbasu

A lightweight CSS framework written in Sass.
SCSS
92
star
14

LiipDoctrineCacheBundle

[DEPRECATED] use https://github.com/doctrine/DoctrineCacheBundle
PHP
71
star
15

LiipMagentoBundle

[DEPRECATED] Proof of concept for integrating Magento into Symfony2 applications
PHP
67
star
16

LiipMonitor

Deprecated: Generic PHP library to run application health checks
PHP
61
star
17

Radios

An mp3 streaming Application for the iPhone and the iPad
Objective-C
59
star
18

drifter

Drifter is a framework to help provision developer boxes using Ansible and Vagrant
HTML
57
star
19

chusho

A library of bare & accessible UI components and tools for Vue.js 3
TypeScript
55
star
20

SEO-keywords-generator

Keyword generator providing multiple commands in order to manage keyphrases for SEO monitoring tools such as AWRCloud
Python
52
star
21

LiipUrlAutoConverterBundle

[DEPRECATED] This bundle will add a Twig Extension for templates with a new filter for automatically converting urls and emails in a string to html links
PHP
50
star
22

extend-block-example-wp-plugin

Example how to extend an existing Gutenberg block in WordPress
JavaScript
49
star
23

packaging

deb and rpm packaging solution for php projects
PHP
49
star
24

styleguide-starterkit

A starterkit to create styleguides with Fractal and Webpack.
JavaScript
37
star
25

LiipSearchBundle

[DEPRECATED] Google XML API for searching is discontinued
PHP
35
star
26

LiipProcessManager

Provides a simple locking mechanism based on UNIX process id's written to a "PID file".
PHP
33
star
27

LiipVieBundle

[DEPRECATED] in favor of SymfonyCmfCreateBundle
JavaScript
32
star
28

viewmodel-savedstate-helpers

Easily save your Android ViewModel state with Kotlin
Kotlin
32
star
29

fanci

Fanci is a lightweight node module to extract, rename and transform JSON based on a template
JavaScript
30
star
30

LiipContainerWrapperBundle

[DEPRECATED] Don't screw DI by just injecting everything.
PHP
29
star
31

LiipCodeBundle

[DEPRECATED] A set of Symfony2 console commands to help developers deal with the various ways of identifying classes, templates, bundles, services, etc. Provides console commands to find their file path or class, as well as editor shortcuts.
PHP
26
star
32

LiipTranslationBundle

Tools for translation management
PHP
25
star
33

guess-the-liiper-ios

Guess the Liiper iOS version made with React Native
JavaScript
25
star
34

dockerbox

A small vagrant based docker box for using docker on OS X and Windows (based on https://github.com/phusion/open-vagrant-boxes)
Shell
25
star
35

packager

Lightweight package installer written in python
Python
22
star
36

LiipXsltBundle

[DEPRECATED] Renderer for XSLT templates in Symfony2 (not actively maintained)
PHP
20
star
37

LiipHyphenatorBundle

[Deprecated] Adds support to Symfony for hyphenating long words using the Org_Heigl_Hyphenator library.
PHP
20
star
38

SweetPreferences

Add syntactic sugar to your Android SharedPreferences
Kotlin
19
star
39

wrench

wrench: a CLI tool for Passbolt
Python
19
star
40

barcode.js

POC for a JavaScript barcode reader, blog post to follow
JavaScript
19
star
41

django-ansible

Deploy Django projects generated by liip/django-template with Ansible
Python
18
star
42

animate-blocks-wordpress-plugin

Animate Gutenberg blocks plugin for WordPress
JavaScript
18
star
43

presence

Presence shows you the availabilities of your set up team by analyzing their Google Calendar
PHP
18
star
44

django-template

Project template for Django projects
Python
17
star
45

metadata-parser

A PHP metadata parser for domain models
PHP
16
star
46

commit-hook-email

GitLab and Github Commit Email Hook
PHP
16
star
47

DataAggregator

[DEPRECATED] The data aggregator cumulates/filters information provided by one or more loader and routes them to one or more persistence layers.
PHP
16
star
48

magento-xhprof

[In Development] Profile Magento with XHProf
PHP
15
star
49

SwissGovernmentChatbots

15
star
50

bund-drupal-starterkit

PHP
14
star
51

styleguide

Liip Web Styleguide
SCSS
14
star
52

roger-q

Tool to work with RabbitMQ queues, including commands to dump, deduplicate and publish messages
PHP
14
star
53

liip10yearsgame

Jump and run through Liip's 10 year history
JavaScript
13
star
54

ckanext-ddi

CKAN extension for DDI, developed for the World Bank
Python
12
star
55

LiipSoapRecorderBundle

[DEPRECATED] Recorder/Player for SOAP communications
PHP
12
star
56

pontsun

The Liip docker local development orchestrator
12
star
57

wp-tyk-dev-portal

A WordPress plugin that adds a developer portal for a Tyk API Gateway
PHP
12
star
58

LiipMultiplexBundle

[DEPRECATED] Symfony2 controller that allows calling multiple URL's in one request as well as JSON-ifying any controller
PHP
12
star
59

LiipRokkaImagineBundle

integration between LiipImagineBundle and rokka.io
PHP
11
star
60

LiipKit

LiipKit regroups usefull classes/extensions used in many applications
Swift
11
star
61

LiipDrupalConnectorModule

An abstraction layer between the procedural world of Drupal and OOP.
PHP
11
star
62

serializer-jms-adapter

An adapter to make liip/serializer a drop-in replacement for jms/serializer
PHP
10
star
63

LiipFormTranslationChoiceBundle

[DEPRECATED] A Symfony2 bundle that provides a form widget and a validator that work with translation domains
PHP
10
star
64

packaging_demo

A demo project for the packaging solution at http://github.com/liip/packaging
PHP
9
star
65

LiipOneallBundle

[DEPRECATED] Symfony2 Bundle to integrate oneall.com
PHP
9
star
66

oc-blocks-theme

OctoberCMS theme that demonstrates the use of repeater groups to assemble static pages with customizable building blocks.
HTML
9
star
67

taxi-zebra

Zebra backend for Taxi
Python
8
star
68

niweaapp

The Tages-Anzeiger iPas App done in Niwea aka HTML5/CSS/JS
JavaScript
8
star
69

directus-utilities

Utility library for directus
TypeScript
8
star
70

frctl-twig

frctl-twig is an PHP Twig adapter for Fractal consisting of an NPM and a Composer package.
PHP
8
star
71

LiipFoxycartBundle

[DEPRECATED] Symfony Foxycart integration Bundle
PHP
8
star
72

discourse-multilingual-support

Provide some tools to have a better multilingual support on Discourse
Ruby
8
star
73

wrapper-block-example-wp-plugin

This is a WordPress plugin which shows how to create a wrapper block for Gutenberg.
JavaScript
7
star
74

e2e-tests-example-wp-plugin

Example how to write E2E tests for a Gutenberg block in WordPress
JavaScript
7
star
75

bower-lockfile-resolver

adds a missing feature of bower: a lockfile with all pacakages versions pinned
JavaScript
6
star
76

bund_ds

Vue
6
star
77

magerant

Magento Vagrant Setup (powered by Ansible)
Shell
6
star
78

jelapi

A Jelastic API Python library
Python
6
star
79

requests_gpgauthlib

A GPGAuth Client in Python
Python
5
star
80

ckan-vagrant

Vagrant based CKAN development environment
Ruby
5
star
81

LiipDrupalCrudAdminModule

The idea behind this module is to provide a most forward standard implementation to handle CRUD operations.
PHP
5
star
82

storybook-starterkit

A starterkit to create styleguides with Storybook and Twig.
JavaScript
5
star
83

directus-extension-gzip-hook

Directus extension gzip hook
TypeScript
4
star
84

liip-cookbooks

4
star
85

OpenLayersOfflineDemo

Demonstrate the offline storage with OpenLayers
JavaScript
4
star
86

fabliip

Set of Fabric functions to help deploying websites.
Python
4
star
87

Okapi

Okapi is a small framework for building web applications. It's built on PHP and XSLT and is fantastic for integration with REST web services.
PHP
4
star
88

html2kirby

Convert HTML markup to Kirby Markup
Python
4
star
89

liip-magento-shared

Liip Magento Shared
PHP
4
star
90

Backbone.localStorageSync

A caching layer between the client and server
JavaScript
4
star
91

Sodium.Xamarin

Xamarin compatible wrapper for libsodium
C#
3
star
92

magento-order-email-jsonld

PHP
3
star
93

magento-config-search

PHP
3
star
94

LiipDrupalRegistryModule

This module provides an API to store key/value pairs of information.
PHP
3
star
95

LiipTeraWurflBundle

[DEPRECATED] Symfony2 Bundle for the wurfl user agent. Not working! For reasons why check the url below ..
PHP
3
star
96

kanbasu-vue

Kanbasu components as Vue components
JavaScript
3
star
97

bund_drupal_starterkit_theme

CSS
3
star
98

smoke-detector

๐Ÿšญ Allow us to be notified when there is smoke in the office.
Python
3
star
99

ushahidi-plugins-mobile

Mobile Accessible Version of Ushahidi
PHP
3
star
100

image-selector-example-wp-plugin

Example how to create an image selector for a Gutenberg block in WordPress
JavaScript
3
star