Bludit plugins basics
Plugins in Bludit resides in bl-plugins folder, and they have a predefined 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.phpName 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-08-01",
"license": "MIT",
"compatible": "3.0",
"notes": ""
}Hello World
The Hello World plugin for Bludit, the below code needs to be in the file plugin.php.
<?php
class pluginHello extends Plugin {
public function siteSidebar() {
echo 'Hello world';
}
}
?>Download the source code of the plugin Hello World.