The BlackCat CMS droplets module is based on the Droplets module included in
Website Baker, but completely rewritten and with lots of new features.
Droplets are small chunks of php code
(just like the code module) that can be included in your template or any other
content section.
Including a droplet is done by encapsulating the droplet name in double brackets.
Example:
If you want to use the droplet "LoginBox", you only need to add
[[LoginBox]] to your template or a WYSIWYG section on your
page.
You are encouraged to create your own droplets and share them with the community.
Installation
The droplets module is installed as an Admin Tool. As it is shipped with
BlackCat CMS, you don't have to install it separately. If you need to install an
upgrade, just install it like any other module in the BlackCat CMS backend.
Usage
You need to have the permission to access [Admin Tools] -> [Droplets] to
use this tool.
Clicking the tool will display the current installed droplets. Depending on
your permissions, you will be able to
create (add) your own Droplets;
edit existing Droplets;
activate / deactivate Droplets;
duplicate Droplets (to create a new one based on an existing one);
delete Droplets;
import (install) new Droplets;
export (backup) Droplets;
manage Droplet permissions;
Getting droplets
A number of droplets are available for use with Website Baker which will also
work with BlackCat CMS, too. You can use the
Official Droplets Library
on the AMASP project website, or you can search the WB Forum. You may use any
Website Baker Droplet on BlackCat CMS.
To see which Droplets are available especially for BlackCat CMS, please visit
the Droplets Section
in our Addons Repository.
Droplets can be added by copy&paste or by direct upload (import) of an appropriate ZIP file.
Coding Droplets
Droplets run in PHP mode, no <?php
or ?> is allowed in the code!
If any of these tags are found in the code they will be removed. Your code
will not run as expected.
The droplet code can NOT echo or print data to the output stream directly.
The Droplet name is replaced by the return value of the PHP code.
Take a look at the Droplets that come with the module for examples.
Droplets can modify the complete page content.
When the Droplet is called, an extra variable ($wb_page_data) is made available.
This variable holds all the content of your current generated webpage.
You can modify any part of this content simply by replacing it in the variable.
There is no need to return this variable, the Droplet code will process changed
content automatically.
The Droplets Admin Tool will check the PHP code you have saved for validity.
When the code will not execute correctly a red flashing icon
will apear in the backend Droplets list.
The standard blue icon
is no guarantee that the Droplets does what you would expect it to do, it
will just tell you if the code is valid PHP code.
Droplets do not need to return any data. When you end your code with
return true; there will not be an error message. The processed
Droplet tag will just be removed.
PHP color coding
The Droplets edit page is ready to use the EditArea module. This module
creates a color coded editor for PHP code. EditArea is not included with the BlackCat CMS Core,
but you can download it here
and install it. If installed, the Droplets Admin Tool will use it automatically.
Exporting Droplets
You can backup your Droplets checking the checkboxes of the Droplets you
wish to save and hit
This will save all marked Droplets as single PHP files into a ZIP file. You
can take this ZIP and it on another
BlackCat CMS Installation, for example.
To see a list of all backups you created, click on the
button. This button will only
appear if there really are backup files. You can now manage your backups,
i.e., delete, recover or download them, see how much files (=Droplets) are included,
and even view a list of included files. To see the list, place the mouse pointer on the file
name; a "tooltip" will appear that shows the files contained in the ZIP.