Project

General

Profile

1
<html>
2
    <head>
3
    <meta charset="utf-8" />
4
    <title>Droplets</title>
5
    <link href="readme.css" rel="stylesheet" type="text/css" media="screen" />
6
    </head>
7
    <body>
8
        <h2> <img src="../themes/default/img/droplets_logo.png" alt="" width="297" height="81" ></h2> <br />
9
        Droplets are small chunks of php code (just like the code module) that can be included in your template or any other content section. <br />
10
        Including a droplet is done by encapsulating the droplet name in double brackets. <br />
11
        If you want to use the droplet &quot;ModifiedWhen&quot; (to show the last modified date and time of the current page) you only need to add <b>[[ModifiedWhen]]</b> to your template or WYSIWYG contentpage. <br />
12
        <br />
13
        You are encouraged to create your own droplets and share them with the community. <br />
14
        <br />
15
        <h3>Installation</h3>
16
        <br />
17
        Droplets are installed as a admin tool. The installation is done using the normal &quot;Add module&quot; page in the WB backend. <br />
18
        When the installation is successfull, there is a new tool added to the Admin-Tools menu. <br />
19
        Clicking the tool will display the current installed droplets, and a button to create your own. <br />
20
        <br />
21
        <h3>Getting Droplets</h3>
22
        <br />
23
        A fast growing number of Droplets are available for use, you can use the <a href="http://www.websitebakers.com/pages/droplets/official-library.php" target="_new">Official Droplets Library</a> in the AMASP project website, or you can search the WB Forum. <br />
24
        <br />
25
        <h3>Coding Droplets</h3>
26
        <br />
27
        Droplets run in PHP mode, no <span style="color: #ff0000">&lt;?php</span> or <span style="color: #ff0000">?&gt;</span> 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. <br />
28
        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.<br />
29
        Example: [[HelloWorld]] <br />
30
        <br />
31
        <span style="color: #ff0000">Wrong code:</span> echo &quot;Hello World&quot;; <br />
32
        <span style="color: #339966">Correct code:</span> return &quot;Hello World&quot;; <br />
33
        <br />
34
        Since version 0.3 Droplets can modify the complete page content. <br />
35
        When the Droplet is called, an extra variable ($wb_page_data) is made available.
36
        This variable holds all the content of your current generated webpage.
37
        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.<br /><br />
38

    
39
        Since version 0.3 Droplets will check the PHP code you have saved for validity. <br />
40
        When the code will not execute correctly a red flashing icon will apear in the backend Droplets list. <br />
41
        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.<br /><br />
42

    
43
        Since version 0.3 Droplets you do not need to return any data. When you end your code with <pre>return true;</pre> there will not be an errormessage. The processed Droplet tag will be removed.<br />
44
        <br />
45
        <h3>PHP color coding</h3>
46
        <br />
47
        The Droplets edit page is ready to use the EditArea module. This module creates a color coded editor for PHP code. <br />
48
        <br />
49
        <br />
50
    </body>
51
</html>
(3-3/3)