Thursday, May 26 in 2022
Module Frontpage Slideshow

 

Index

  Description
  Call
  Installation
  Backend
  Modify Droplets
  Add Droplets
  Examples

 

 

Description

pfeil
   

Website Baker 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 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.

 

 

Call

pfeil
   

Droplets are defined in your site using double-square-brackets. An example of a Droplet definition is [[ExampleDroplet]].

 

 

Installation

pfeil
   

After Download the module is installed via Website Baker Backend as usual up to Release 2.7). From Release 2.8 Droplets are part of the WB package and are installed as a standard.

  Backend: Addons/Module
 

 

 

Backend

pfeil
   

After installation the module Droplet appears in the backend at "Admin-Tools". If you open the module you will have the same look as the image on the right. You can modify existing Droplets (some examples will be installed together with the module installation), and you can add new Droplets by using the "Add" button.

  Backend: module Droplet

 

 

Modify Droplets

pfeil
 

To modify Droplets you have to use the edit mode (similar to the News module) (click the droplet). Then the edit mode appears and you are able to edit the code ( don't forget to save ). It is helpfull to write the call beneath some notices into the comment box.

  Backend: Modify Droplets

 

 

Add Droplets

pfeil
 

To add Droplets you have to click the "Add" button. This openes a new window and you are able to put the php code into the boxes (don't forget to save ). It is helpfull to write the call beneath some notices into the comment box.


Backend: Add Droplets

 

 

Examples

pfeil
 

To use the Droplet in a WYSIWYG-Section, you simply have to put it ( in this example searchbox ) into the editor where you want to have the return displayed (see image on the right).

You will have this result at the frontend:
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 . 

 

 

New LEPTON CMS