Plugin basics
Contents
Plugins in Bludit reside in the bl-plugins
folder, and they have a predefined structure. Each plugin is an object in Bludit, with differents hooks (methods).
Folder and Files Structure
These are the mandatory folder structure and files for a plugin:
/bl-plugins/{PLUGIN_NAME}/
languages/en.json
metadata.json
plugin.php
Name and Description
The name and description of the plugin is located in the JSON file, languages/en.json
.
{
"plugin-data":
{
"name": "Hello World",
"description": "Print Hello World in the sidebar"
}
}
Information
The meta information of the plugin is located in the JSON file, metadata.json
.
{
"author": "Bludit",
"email": "",
"website": "https://plugins.bludit.com",
"version": "1.0",
"releaseDate": "2020-06-01",
"license": "MIT",
"compatible": "3.0",
"notes": ""
}
Hello World
The Hello World plugin for Bludit. The code below needs to be in the plugin.php
file.
<?php
class pluginHello extends Plugin {
public function siteSidebar() {
echo 'Hello world';
}
}
?>
Download
Download the source code of the plugin Hello World.