Custom Widget Configuration Property

Version 11.1 - wondering the proper interface to implement if I wanted to create a custom Widget Configuration property.

I believe in prior versions I used an IPropertyControl

Parents Reply
  • This works for me to display Hello World:

    using System.Collections.Generic;
    using System.IO;
    using Telligent.Evolution.Extensibility.Configuration.Version1;
    
    namespace Samples
    {
        public class TestPropertyTemplate : IPropertyTemplate
    	{
    		#region IPlugin
    
    		public string Name => "Test Template";
    
    		public virtual string Description => $"template test";
    
    		public virtual void Initialize()
    		{
    		}
    
    		#endregion
    
    		#region IPropertyTemplate
    
    		public string[] DataTypes => new string[] { "Custom" };
    
    		public string TemplateName => "testTemplate";
    
    		public bool SupportsReadOnly => true;
    
    		public virtual PropertyTemplateOption[] Options
    		{
    			get
    			{
    				var options = new List<PropertyTemplateOption>();
    				return options.ToArray();
    			}
    		}
    
    		public void Render(TextWriter writer, IPropertyTemplateOptions options)
    		{
    			string script = "hello world";
    
    			writer.Write(script);
    		}
    		#endregion
    	}
    }
    

    Here is the configuration declaration:

    	<property id="test" defaultValue="" dataType="Custom" template="testTemplate" />
    

Children