{{{#!box important
This page was a draft of changes now integrated to [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.prefs.api.IPreferencePanelProvider].
}}}
== Extension Point : ''IPreferencePanelProvider'' ==
||'''Interface'''||''IPreferencePanelProvider''||'''Since'''||[wiki:TracDev/ApiChanges/0.11#IPreferencePanelProvider 0.11]||
||'''Module'''||''trac.prefs''||'''Source'''||[source:psuter/trac/prefs/api.py@advanced-notification-preferences#/IPreferencePanelProvider api.py]||
The ''IPreferencePanelProvider'' allows adding panels to Trac's preferences dialog.
== Purpose ==
Trac provides a [wiki:TracDev/ReleaseNotes/0.11#UserPreferences user preferences] system. Plugins can participate in this system by implementing the IPreferencePanelProvider. This allows a unified web UI where all preferences are configured in the same place, the preferences dialog.
When a user browses to the preferences dialog, all implementations are called to provide any implemented panels, which are shown as tabs. When the user activates a tab the respective implementation is called to render the page corresponding to that tab.
Since Trac 1.1.3 different implementations can provide ''child panels''. These show up as sections in a tab of their parent panel, which can be implemented by a different plugin. A modular ecosystem of thematically related plugins can use this to populate a shared preferences page.
== Usage ==
Implementing the interface follows the standard guidelines found in [wiki:TracDev/ComponentArchitecture] and of course [wiki:TracDev/PluginDevelopment].
The implementation has to render a panel by returning a template file name and a data dictionary to be used by that template. (See [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.chrome.ITemplateProvider ITemplateProvider] and [wiki:TracDev/PluginDevelopment/ExtensionPoints/trac.web.api.IRequestHandler IRequestHandler])
The panel template should {{{