Download the PHP package gebruederheitz/wp-block-collapsible without Composer
On this page you can find all versions of the php package gebruederheitz/wp-block-collapsible. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gebruederheitz/wp-block-collapsible
More information about gebruederheitz/wp-block-collapsible
Files in gebruederheitz/wp-block-collapsible
Package wp-block-collapsible
Short Description A collapsible / accordion block for gutenberg
License GPL-3.0-only
Informations about the package wp-block-collapsible
WP Block: Collapsible
A collapsible / accordion block for gutenberg
Installation
All the JS bits via NPM
All the PHP bits via Composer
Usage
In the editor
You may provide custom attributes, methods / components etc.:
On the frontend
You will need to add the initializer scripts to your frontend script bundle in order for the block to work:
Rendering the block's output
In all cases will need to register the block on the backend.
Dynamically through PHP
If you're using the "dynamic" save method (the default), you will also have to
provide a template to render the output. The composer parts of this library
(gebruederheitz/wp-block-collapsible
) will take care of that for you:
You can override the default template by putting an alternative template file
into wp-content/themes/your-theme/template-parts/blocks/collapsible.php
. Take
a look at the original template for some
inspiration. Note that you might have to change the frontend scripts if you
change the block's markup.
"Statically" through Gutenberg's React
This library provides an alternative save method that removes the need for dynamic processing of the block's content for each request by statically rendering the markup at "publish time".
Naturally you can also provide your own static renderer component in place of the pre-packaged one.
Styling
You may use and extend the default styles and themes provided by this package in your (S)CSS:
Or use the precompiled CSS files:
Creating a custom theme
The SCSS stylesheets rely heavily on default SCSS variables to simplify theming. One basic approach would be to modify the parameters for one of the existing themes:
Development
Dependencies
- PHP >= 7.3
- Composer 2.x
- NVM and nodeJS LTS (v16.x) with npm
- Nice to have: GNU Make (or drop-in alternative)
Quickstart
You can use the watch task:
After making your changes to scripts or styles, run
to create the stylesheets and ES-module bundles at dist/
.
Run make release
to publish a new version. release-it
will guide you through
the process.
make test
or make lint
will lint all the source scripts and stylesheets.