System modules and system module settings

In the main sidebar/aside, there is a main menu item called System. Under that main menu item, there is a submenu item called Modules. When navigating to that submenu item, Appskull will display all the system modules.

There are two types of system modules.

  1. 'Core' type system modules

    These types of modules are the ones that are required for a bare-bones Appskull installation to work.

  2. 'Other' type system modules

    These types of modules are the ones that add additional features to the bare-bones Appskull installation.

In the module listing, they are grouped based on their respective author/vendor, and by default, they are displayed in a collapsed manner. From these module listings, we can obtain their basic information, such as module name, module description, module author, author URL, and module version. Some modules provide a link to the settings page of that particular module.

How to list a new module on 'System modules' page

System modules

To list a new module on the System Modules page, you need to create a few specific files in particular locations. These files adhere to a standardized naming convention that you must follow. If everything is done correctly, the system will automatically list the new module.

  1. Config file (Module.php)

    This file should be located in the Config directory, which is in the root of the module. This class file should consist of five required public properties.

    1. type

      You can assign this property one of two predefined string values: core or other. Assigning the property the value core will result in the module being listed under System core modules on the System Modules page. Assigning it the value other will list the module under System non-core modules on the System Modules page.

    2. slug

      You should assign this property with the name of your module in camel case. For example, if your module name is The hello world, then the string value should be theHelloWorld.

    3. authorURL

      Assign this property with the value of the module author's URL.

    4. authorEmail

      As the property name suggests, assign this property with the module author's email.

    5. version

      Assign this property with the module version number. Even though it's a number, use the string data type to represent it. Increase this number each time you update the particular module.

  2. View file (Module.php)

    This file should be located in the view directory, which is in the root of the module. This view file should contain a Bootstrap accordion item that includes the module information (Check corresponding files in built-in modules for sample codes. You can copy paste those codes and do necessary changes.).

  3. Language file for view file (Module.php)

    This file should be located in the corresponding view file's location within the desired language directory.

System module settings

App module settings

You can add system module settings for any module. These settings can be used to easily override default module configurations.

  • Controllers

    When creating controllers for module settings, create a directory named Settings within the Controllers directory at the module's root, and place them inside it.

  • Models

    Most of the time, you may not have to create custom database model files for system module settings, as there is a model file named SystemSettings.php in the Models directory located in the root of the App module. This model file can handle most of the system module settings operations. However, in rare situations, you may need to implement something more customized, in which case you would have to create custom database models.

  • Views

    Follow the corresponding controller file names and path/directory structure for views. Create additional directories if you need further organization.

  • Language files

    Follow the corresponding controller/view file names and path/directory structure for language files.

The easiest way...

The easiest way to understand things and get sample codes regarding system module listing and creating system module settings is reverse engineer how we have done those things in the built-in modules of Appskull.

Copyright © Nudasoft.