Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi There, if i want to set default view to custom field , how do you do this.
for example for below code , how to enter default value
thanks
public class Textfield : FieldType
{ public Textfield() { //Provider this.Id =newGuid("3F92E01B-29E2-4a30-BF33-9DF5580ED52C"); this.Name = "Textfield"; this.Description ="Renders a html input fieldKey"; //FieldType this.Icon = "icon-autofill"; this.DataType = FieldDataType.String; this.Category = "Simple"; this.SortOrder = 10; }
To get this to work for me i added another "using" to the top of the .cs file.
using Umbraco.Forms.Core.Attributes;
Then inside your public class Testfield : FieldType i added
[Setting("DefaultValue", Description = "Enter a default value", View = "TextField")] public string DefaultValue { get; set; }
This should then make an option in the settings when configuring the field to add a Default Value.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
custom field default value
Hi There,
if i want to set default view to custom field , how do you do this.
for example for below code , how to enter default value
thanks
public class Textfield : FieldType
To get this to work for me i added another "using" to the top of the .cs file.
Then inside your public class Testfield : FieldType i added
This should then make an option in the settings when configuring the field to add a Default Value.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.