Plugin basics

    Plugins in Bludit resides in bl-plugins folder, and they have a pre-defined structure. Each plugin is an object in Bludit, with differents hooks (methods).

    Folder and Files Structure

    This is a mandatory folder structure and files for a plugin.

    /bl-plugins/{PLUGIN_NAME}/
        languages/en.php
        metadata.json
        plugin.php

    Name and Description

    The name and description of the plugin is in the JSON file languages/en.json.

    {
        "plugin-data":
        {
            "name": "Hello World",
            "description": "Print Hello World in the sidebar"
        }
    }

    Information

    The information of the plugin is in the JSON file metadata.json.

    {
        "author": "Bludit",
        "email": "",
        "website": "https://plugins.bludit.com",
        "version": "1.0",
        "releaseDate": "2018-02-15",
        "license": "MIT",
        "compatible": "2.0, 2.1, 2.2, 2.3",
        "notes": ""
    }

    Hello World

    The Hello World plugin for Bludit, the bellow code need to be in the file plugin.php.

    <?php
        class pluginHello extends Plugin {
            public function siteSidebar() {
                echo 'Hello world';
            }
        }
    ?>
    Download
    Download the source code of the plugin Hello World.