Configuring the moduleΒΆ

Global configuration variables for the site may be defined in the config element of module.xml. Values for these settings can be filled in when you edit the site in the admin console.

    <field-set name="info">
        <input type="TextLine" name="company">
          <occurrences minimum="1" maximum="1"/>
        <input type="TextArea" name="description">
          <occurrences minimum="1" maximum="1"/>

To use the module configuration values, the controller can read the values and use it.

// Get the current site.
var site = execute('portal.getSite');

// Find the module configuration for this module in current site.
var moduleConfig = site.moduleConfigs['com.enonic.first.module'];