Tridion Stack Exchange is a question and answer site for Tridion developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 12 down vote accepted

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.

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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