Friday, January 23, 2015

How to Build an OctoberCMS Widget Plugin

In a previous article we talked about the basics of creating an OctoberCMS plugin. In this one, we’re going to go deeper, and we’ll explore how we can extend the OctoberCMS backend using widgets.


OctoberCMS


What We Are Going To Build


I will assume that many of you have used Wordpress. On the dashboard, we have a quick draft widget. In this article, we’re going to see how we can build a similar one for OctoberCMS.


Quick Notes Widget

Quick Note Widget Listing


Plugin Registration


To start building our plugin, we’ll use a command utility for scaffolding.



php artisan create:plugin RAFIE.quicknote

The command will create a Plugin.php file and an updates folder containing the version.yaml file.



public function pluginDetails(){
return [
'name' => 'Quick Note Widget',
'description' => 'Add and manage some drafts when you\'re in a hurry.',
'author' => 'RAFIE Younes',
'icon' => 'icon-pencil'
];
}


After registering our plugin we need to update our version.yaml file.



// uploads/version.yaml
1.0.1: First version of quicknote
1.0.2:
- Created Notes Table
- create_notes_table.php


Continue reading %How to Build an OctoberCMS Widget Plugin%




by Younes Rafie via SitePoint

No comments:

Post a Comment