10

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?

11

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.

  • 2
    What is the type of the $config.Editors["YourEditor"].configuration variable? String? – Quirijn Jan 14 '16 at 12:15
  • 3
    Yes, it's a string. You can then load it as XML using $xml.getNewXmlDocument() – Peter Kjaer Jan 14 '16 at 12:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.