MagicMirror² v2.13.0 is available! For more information about this release, check out this topic.

Is it possible to have custom information for each module in the config file?


  • Module Developer

    In order to improve the usability of my page system, I would like to be able to use a custom piece of information in the config file to define pages and positions for the Modules.

    {
        "module": "clock",
        "position": "top_right",
        "pages": {"pageName": "position"},
        "config": {}
    }
    

    However, it seems just using getModules.enumerate() doesn’t supply that new pages object.
    As a workaround, I noticed that the config for each module is given and so the page’s object could be stored inside that. However, for less confusing use, I would rather have it outside.
    The other option I would explore is simply importing the config into my node_helper and then parsing the config manually, but before I went ahead with the plan I wanted to see if there is some reason to refrain from that.

    Is there a correct way to do this? Is it correct to do this at all?


  • Module Developer

    After trying out the method of importing the config, it works well and seems to be stable. If anyone has any reason why not to require the config.js in a node_helper file, I would appreciate an explanation.


Log in to reply