greenpeace / planet4-gpnl-plugin-blocks
This repository contains the WordPress plugin that provides the blocks to be used with Shortcake UI plugin.
Installs: 1 616
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 14
Forks: 0
Open Issues: 5
Type:wordpress-plugin
Requires
- ext-curl: *
- ext-openssl: *
Requires (Dev)
- dev-master
- 2.15.4
- 2.15.3
- 2.15.2
- 2.15.1
- 2.14.0
- 2.13.5
- 2.13.4
- 2.13.3
- 2.13.2
- 2.13.1
- 2.13.0
- 2.12.1
- 2.12.0
- 2.11.4
- 2.11.3
- 2.11.2
- 2.11.1
- 2.11.0
- 2.10.5
- 2.10.4
- 2.10.3
- 2.10.2
- 2.10.1
- 2.10.0
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.6
- 2.8.5
- 2.8.4
- 2.8.3
- 2.8.2
- 2.8.1
- 2.8.0
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.8
- 2.6.7
- 2.6.6
- 2.6.5
- 2.6.4
- 2.6.3
- 2.6.2
- 2.6.1
- 2.5.3
- 2.5.2
- 2.5.1
- 2.4.0
- 2.3.6
- 2.3.5
- 2.3.4
- 2.3.3
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.30
- 2.2.29
- 2.2.28
- 2.2.27
- 2.2.26
- 2.2.25
- 2.2.24
- 2.2.23
- 2.2.22
- 2.2.21
- 2.2.20
- 2.2.19
- 2.2.18
- 2.2.17
- 2.2.16
- 2.2.15
- 2.2.14
- 2.2.13
- 2.2.12
- 2.2.11
- 2.2.10
- 2.2.9
- 2.2.8
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.0.0
- dev-dependabot/npm_and_yarn/ini-1.3.7
- dev-dependabot/npm_and_yarn/node-sass-4.14.1
- dev-dependabot/npm_and_yarn/lodash-4.17.19
- dev-dependabot/npm_and_yarn/websocket-extensions-0.1.4
- dev-dependabot/npm_and_yarn/acorn-5.7.4
- dev-develop
- dev-release/v2.15.3
- dev-feature/petition-sharing
- dev-chore/cleanup
- dev-feature/nonces
- dev-feature/address-api
- dev-feature/newsletter-nonce
- dev-feature/donation-icons
- dev-release/v2.11.2
- dev-feature/education
- dev-feature/newsletter-urlshielding
- dev-release/v2.10.1
- dev-release/v2.10.0
This package is auto-updated.
Last update: 2021-01-11 02:51:19 UTC
README
This WordPress plugin provides blocks to be used with Shortcake UI plugin. This plugin is developed by Greenpeace Netherlands to be used in the Planet4 engagement platform.
Currently this plugin adds the following new shortcodes:
- Donation form
- Petition form
- No-index (to discourage search engines from indexing)
- Liveblog
Coming in the near-future (available on dev-branch)
- Quote block with image
- Statistics block in 3 columns
- New hero image header
In the backlog are among others:
- Information request form
- interactive maps
How to develop a new block you ask?
-
Create a new controller class that extends Controller inside directory classes/controller/blocks. The class name should follow naming convention: GPNL_Blockname_Controller and its file name should be class-blockname-controller.php.
-
Implement its parent's class two abstract methods:
- In method prepare_fields() you need to define the blocks fields
- In method prepare_template() you need to prepare them for rendering.
-
Create the template file that will be used to render your block inside directory includes/blocks. If the name of the file is gpnl_blockname.twig then you need to set the BLOCK_NAME constant as gpnl_'blockname'
-
Add your new class name to the array that the
P4BLBKS\Loader
function takes as an argument inplanet4-gpnl-blocks.php
. -
Finally, before committing do
composer update --no-dev && composer dump-autoload --optimize
in order to add your new class to composer's autoload.
And how do i build new assets?
Asset sources are located in:
/includes/assets/
/js/src/
/css/scss/
Gulp builds the buildfiles into the parent directories of the sourcesfiles (so /js/
and /css
/). Maps are placed in /maps/
...
Using your favorite package manager install
the required packages from package.json and simply run gulp watch
or gulp
.
Known issues
Currently Firefox does not read the maps correctly. Chrome/Chromium does.