# How can I access custom configuration settings in a GUI extension?

According to the documentation, the settings element in a GUI editor (or model) config file can contain an element called customconfiguration (see http://docs.sdl.com/LiveContent/content/en-US/SDL%20Tridion%20full%20documentation-v1/GUID-ACE0B7E2-31DC-40CC-BEC5-B3D6FD76EDE5).

I suppose I can enter my own configuration settings there. But what's not clear to me is how these settings should be formatted and how I can use them in my code. Can anyone point me in the right direction?

Server-side

The XML is available through the ConfigurationManager object from Tridion.Web.UI.Core:

XmlDocument myConfigurationXml = ConfigurationManager.Editors["MyEditor"].CustomXml


Client-side

You need to add a child node called 'clientconfiguration' (same namespace) with the settings you want. The format of the content under that node is up to you. I would recommend keeping it XML, but if you put it in a CDATA section you can use any format you like.

The configuration is automatically made available client-side through the $config.Editors["YourEditor"].configuration variable. Model configuration For all of the above, you may add substitute "Editor" with "Model" to have custom configuration for your model too. • What is the type of the$config.Editors["YourEditor"].configuration variable? String? – Quirijn Jan 14 '16 at 12:15
• Yes, it's a string. You can then load it as XML using \$xml.getNewXmlDocument() – Peter Kjaer Jan 14 '16 at 12:19