codoforum
folder and browse to sites/default/plugins/
. Create the plugin folder helloblock
here. Inside the folder create the required files helloblock.info.php
& helloblock.php
as shown in the image above.
myplugin
, then
the two files will be myplugin.info.php
& myplugin.php
helloblock.info.php
file tells codoforum that your plugin exists and adds it to the plugin management system in the backend so that it can be activated. As a minimum, the plugin name, version and core is required, but you can provide other information such as a description or author details. The info code can be seen below – this should be added to the helloblock.info.php
<?php
$info['name'] = 'Hello Block';
$info['plugin_type']= 'block'; //tell the forum that it is a block
$info['description'] = 'A Demo Plugin';
$info['version'] = '1.x';
$info['author'] = "codologic";
$info['author_url'] = 'http://codologic.com';
$info['license'] = 'MIT License';
$info['core'] = '1.x'; //works with which version of the forum?
helloworld.php
file and copy the code shown below,
<?php
echo "Hello Block! ";
With that added to the info file, open up codoforum admin in your browser and have a look at the plugins section. The plugin should be listed, click install to activate the plugin as shown below.
Now go to Admin Control Panel, UI Elements >> Blocks >> Add Block
Add a new block as shown below by selecting a desired region and plugin.
The output will now be displayed where ever the region is present.
The output for our region is as shown below.