# Custom Module Settings Page?

**URL:** <https://forum.inductiveautomation.com/t/custom-module-settings-page/7123>\
**Category:** Module Development\
**Created:** [August 22, 2013, 7:45pm UTC](https://forum.inductiveautomation.com/t/custom-module-settings-page/7123 "2013-08-22T19:45:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlangdon](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mlangdon](https://forum.inductiveautomation.com/u/mlangdon)\
**Post date:** [August 22, 2013, 7:45pm UTC](https://forum.inductiveautomation.com/t/custom-module-settings-page/7123/1 "2013-08-22T19:45:09Z")

</div>

Is it possible to have a settings page for a custom module in the Gateway in much the same way that the Mobile Module does? I want to have a user configurable port number in a module that otherwise has no direct UI.

---

<div class="post-metadata">

**Author:** ![nclemeur](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@nclemeur](https://forum.inductiveautomation.com/u/nclemeur)\
**Post date:** [August 22, 2013, 11:13pm UTC](https://forum.inductiveautomation.com/t/custom-module-settings-page/7123/2 "2013-08-22T23:13:10Z")

</div>

Yes, it is possible. I have done it by following these steps (if anyone see a better or simpler way to do it, please let me know). This is assuming you will store the settings in the internal database:

- create your PersistentRecord class containing your settings

- Add your link to the left menu in the config section by adding it to the `GatewayContext.getConfigMenuModel`

- [Optional, I believe] Customise your page by extending RecordActionTable and/or EditRecordAction

If you write a driver you might not need add your link to the left menu.

It is not very easy initially, but I manage to do it, so it is possible 🙂 Don’t hesitate to post

Good luck

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 22, 2013, 11:17pm UTC](https://forum.inductiveautomation.com/t/custom-module-settings-page/7123/3 "2013-08-22T23:17:27Z")

</div>

Yep. Here’s a copy/paste example of how it’s done:

```auto
private static final String[] XOPC_MENU_PATH = {"xopc"};

private void addMenuNodes() {
	LabelConfigMenuNode header = new LabelConfigMenuNode(XOPC_MENU_PATH[0], "xopc.config.menutitle");
	header.setPosition(590);

	context.getConfigMenuModel().addConfigMenuNode(null, header);

	LinkConfigMenuNode settingsNode = new LinkConfigMenuNode(
			"settings",
			"xopc.config.settings.menutitle",
			SettingsPage.class);
	context.getConfigMenuModel().addConfigMenuNode(XOPC_MENU_PATH, settingsNode);
}
```

In this case, SettingsPage is a subclass of RecordEditForm, which gives you the settings editing UI you see all over the gateway for one or more of your module’s PersistentRecords.
