Best Development Tools for October CMS Plugin Creators to Buy in September 2025
+
ONE MORE?
To create a plugin in October CMS, you can follow these steps:
- Start by navigating to the plugins directory in your October CMS installation. It is typically located at plugins in the root folder of your website.
- Inside the plugins directory, create a new folder with the desired name of your plugin. This folder will serve as the container for all your plugin files.
- Within the new plugin folder, create a file named Plugin.php. This file will define the basic information and behavior of your plugin.
- Open the Plugin.php file and define a PHP class with the same name as the file. This class should extend the System\Classes\PluginBase class.
- Inside the class, you can add various methods and properties to define your plugin's behavior and functionality. For example, you might define the plugin name, description, version, author, or any other relevant information.
- You can also implement various plugin lifecycle methods such as register, boot, registerComponents, registerSettings, etc. These methods will be invoked at specific stages of the October CMS lifecycle and allow you to perform necessary setup and configurations.
- Besides the core Plugin.php file, you can add other files and directories within your plugin folder. For instance, you might want to create a components directory to store your plugin's frontend components, or a models directory to define database models.
- You can further build your plugin by adding layouts, partials, pages, assets (such as CSS and JavaScript files), or any other resources required for your plugin's functionality. These files are typically organized in their respective directories inside the plugin folder.
- After creating and configuring your plugin, you can navigate to the October CMS backend and navigate to the System section. Here, you can find the Plugins menu item. Activate your plugin by locating it in the list and clicking the "Activate" button.
- Once activated, you can start using your plugin's functionality within your October CMS website. You can also customize and extend your plugin as per your requirements by editing the respective files and folders within your plugin's directory.
Remember to refer to the official October CMS documentation for more detailed information on creating plugins and utilizing its various features and conventions.
How to add settings to a plugin in October CMS?
To add settings to a plugin in October CMS, you need to do the following:
- Open your plugin's main PHP file located in the plugins/{Vendor}/{Plugin} directory.
- In the register method of the plugin, add the following code to register your plugin's settings:
public function registerSettings() { return [ 'settings' => [ 'label' => 'Plugin Settings', 'description' => 'Manage Plugin Settings', 'icon' => 'icon-cog', 'class' => 'Vendor\Plugin\Models\Settings', 'order' => 500, 'permissions' => ['vendor.plugin.settings'], ] ]; }
Replace Vendor
with your plugin's vendor name and Plugin
with your plugin's name.
- Create a new PHP file named Settings.php in the models directory of your plugin. In this file, define the structure and defaults of your plugin's settings using the System\Models\SettingsModel class. For example: