Is there a new property template for selecting a string from a list so like a radio button for example

In v12 there are a lot of property templates but I cant see a way to have a plugin configuration property value which allows a user to pick a single value from a list

Can this be done ootb or will we have to write a custom template? 

Its to replace an existing entry like the one below ? 

Property truncationType = new Property("PurgeRecordsType", "Purge Records", PropertyType.String, 1,
    PurgeRecords.AfterAgeInDays.ToString());
truncationType.SelectableValues.Add(new PropertyValue(PurgeRecords.AfterAgeInDays.ToString(),
    "Older Than Days", 0));
truncationType.SelectableValues.Add(new PropertyValue(PurgeRecords.AtCount.ToString(), "Database Rows", 1));
group.Properties.Add(truncationType);

  • The typical way configuration like this is exposed in OOTB UI is with a string template and property values. Something like

    <property id="PurgeRecordsType" labelText="Purge Records" dataType="string" defaultValue="afterAgeInDays">
    	<propertyValue value="afterAgeInDays" labelText="Older Than Days" />
    	<propertyValue value="atCount" labelText="Database Rows" />
    </property>

    This will present an HTML select with the two options. While this is implemented using the new string Property Template , the XML definition of the configuration and its options is unchanged from before the introduction of property templates, since for simple types, the template to be used is inferred.

    Edit:

    For defining configuration forms for plugins, the APIs in Telligent.Evolution.Extensibility.Configuration.Version1 are recommended and are mostly unchanged from DynamicConfiguration, though with a few method signature differences.

    var truncationType = new Telligent.Evolution.Extensibility.Configuration.Version1.Property
    {
    	Id = "PurgeRecordsType",
    	LabelText = "Purge Records",
    	DataType = "String",
    	OrderNumber = 0,
    	DefaultValue = PurgeRecords.AfterAgeInDays.ToString()
    };
    truncationType.SelectableValues.Add(new Telligent.Evolution.Extensibility.Configuration.Version1.PropertyValue
    {
    	Value = PurgeRecords.AfterAgeInDays.ToString(),
    	LabelText = "Older Than Days",
    	OrderNumber = 0
    });
    truncationType.SelectableValues.Add(new Telligent.Evolution.Extensibility.Configuration.Version1.PropertyValue
    {
    	Value = PurgeRecords.AtCount.ToString(),
    	LabelText = "Database Rows",
    	OrderNumber = 1
    });
    group.Properties.Add(truncationType);
    

  • Must have been having a Friday afternoon moment, as that makes perfect sense