Droplets Help

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.
If you want to use the droplet "ModifiedWhen" (to show the last modified date and time of the current page) you only need to add [[ModifiedWhen]] to your template or WYSIWYG contentpage.

You are encouraged to create your own droplets and share them with the community.


Droplets are installed as a admin tool. The installation is done using the normal "Add module" page in the WB backend.
When the installation is successfull, there is a new tool added to the Admin-Tools menu.
Clicking the tool will display the current installed droplets, and a button to create your own.

Getting Droplets

A fast growing number of Droplets are available for use, you can use the Official Droplets Library in the AMASP project website, or you can search the WB Forum.

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.
Example: [[HelloWorld]]

Wrong code: echo "Hello World";
Correct code: return "Hello World";

Since version 0.3 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.

Since version 0.3 Droplets 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.

Since version 0.3 Droplets you do not need to return any data. When you end your code with
return true;
there will not be an errormessage. The processed Droplet tag will 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.