diff --git a/InvenTree/templates/InvenTree/settings/mixins/settings.html b/InvenTree/templates/InvenTree/settings/mixins/settings.html index c4bff23ef6..0b62859c8f 100644 --- a/InvenTree/templates/InvenTree/settings/mixins/settings.html +++ b/InvenTree/templates/InvenTree/settings/mixins/settings.html @@ -9,8 +9,10 @@ - {% for setting in plugin_settings %} - {% include "InvenTree/settings/setting.html" with key=setting plugin=plugin %} + {% for setting, value in plugin_settings.items %} + {% if not value.hidden %} + {% include "InvenTree/settings/setting.html" with key=setting plugin=plugin %} + {% endif %} {% endfor %}
diff --git a/docs/docs/extend/plugins/settings.md b/docs/docs/extend/plugins/settings.md index 89894dcc10..4647718036 100644 --- a/docs/docs/extend/plugins/settings.md +++ b/docs/docs/extend/plugins/settings.md @@ -52,9 +52,17 @@ class PluginWithSettings(SettingsMixin, InvenTreePlugin): MaxValueValidator(25) ] }, + 'HIDDEN_SETTING': { + 'name': _('Hidden Setting'), + 'description': _('This setting is hidden from the automatically generated plugin settings page'), + 'hidden': True, + } } ``` +!!! tip "Hidden Settings" + Plugin settings can be hidden from the settings page by marking them as 'hidden' + This mixin defines the helper functions `plugin.get_setting` and `plugin.set_setting` to access all plugin specific settings: ```python