Skip to content

Droplets and kitCommands

hertsch edited this page Aug 4, 2013 · 13 revisions

WebsiteBaker & LEPTON CMS are very easy to use Content Management Systems which keeps the things simple.

One of the most exciting feature are the Droplets.

Droplets are small chunks of PHP code which can be placed at any WYSIWYG page and also within a frontend template. At the runtime the Droplet command, i.E. SiteModified

SiteModified

will be parsed and replaced with the assigned PHP Code, in the case of SiteModified:

global $database, $wb;    
if (PAGE_ID>0) {  
  $query=$database->query("SELECT max(modified_when) FROM ".TABLE_PREFIX."pages");  
  $mod_details=$query->fetchRow();  
  return "This site was last modified on ".date("d/m/Y",$mod_details[0]). " at ".date("H:i",$mod_details[0]).".";
}

and will output the date of the last modification:

This site was last modified on 17/04/2013 at 18:23.

This works very well with small pieces of code. Because Droplets are not indented to execute applications they can not load CSS files or jQuery and they are ignored by the search function of the CMS.

kitCommands are the powerful grandchilds of the Droplets.

Instead of the square brackets the kitCommand use swung dashes and spaces to indicate the kitCommand:

~~ SiteModified ~~

Like Droplets the kitCommands can be placed at any WYSIWYG content or within frontend templates.

A kitCommand can be used for small code chunks like **~~ SiteModified ~~** or to execute and control complete applications. In a different way from Droplets the kitCommands can load CSS Files, execute JavaScript or jQuery and many more. This Hello World tutorial will give a first view to the usage.

[ Home ] [ Example 1: Hello World! ]

Clone this wiki locally