Customizing the menu

Create a configuration, add custom pages and fill more details for your module


Setting up

By setting the MODULE.menu, you will be able to customize your module's menu.

The setup should looks like this:

main.lua
local MODULE = {
    --  ...
}

MODULE.menu = {
    --  here we will customize our menu:
    --  config = {},
    --  pages = {},
    --  details = {},
}

--  ...

return MODULE

Adding configuration

TODO


Adding pages

Pages are additionals DFormsarrow-up-right that will be created in the module's menu.

To do so, you need to specify the pages table variable.

Each 'page' element must be a function( DForm ) which will modify its own form as you want it to be.

Example

Work-Arounds page, code from basearrow-up-right module:


Adding details

By default, these module properties will show in the sidebar, such as:

  • the author name

  • the local version

  • the remote version (if MODULE.version_url was set and the request was successful)

If you want to customize your module's sidebar such as adding informations & links, you have to specify the details table variable and add all the content you want.

Each string element will show as a category in the sidebar. You can also give a structured table to create links, actions or texts:


Structure

string text

Text of the label


(optional) string icon=nil

Icon path of the detail, used in the menu. The pointed material must be a 16x16px image, use a Silkiconarrow-up-right or make your own. You can also use the iconsarrow-up-right released with the base.


(optional) string url=nil

URL to open when the user clicks on this detail. NOT compatible with the callback property.


(optional) function callback=nil

Custom callback to run when the user clicks on this detail. NOT compatible with the url property.


Example

Code from basearrow-up-right module:


Last updated