Website Baker Droplets
Droplets is the new revolutionary way of inserting PHP code anywhere on your website.
You can add Droplets in your Template, your WYSIWYG section but also within other modules configurable outputs.
Droplets are defined in your site using double-square-brackets.
An example of a Droplet definition is [[ExampleDroplet]]
.
Install Droplets using the module found on this page, look in our official Droplets Library for any code you like.
Droplets are actually small pieces of PHP code, just like you might use in a CODE section.
Some restrictions apply to the used code:
- You cannot use the echo or print commands.
- The data you want to end up in the website output is sent as the "return" value of the Droplet code.
The Droplets are defined in the WB backend in the Admin-Tools section.
When clicked on the Droplets link you will see the current list of installed Droplets.
Clicking on a Droplet name will show some details, including the actual PHP code.
Modified code will (after saving) be active and available directly on your website!
Tip: Create a testing Droplet when you are working on the code, and test it on a hidden page.
You can use any name you like for new Droplets.
If your Droplet needs parameters, you can define them as you would do with the $_GET commandline parameters in PHP.
When you create your Droplet like this [[ExampleDroplet?dir=mydir&width=300&height=200]]
your PHP code will be called, and the variables $dir, $width and $height will be available for use .
If you have created a Droplet that could be of use for someone else, you are encouraged to send the Droplet to us using this form.
After reviewing, the code will be added to our Droplets library.
.
If you have created a Droplet that could be of use for someone else, you are encouraged to send the Droplet to us using this form.
After reviewing, the code will be added to our Droplets library.