Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
Calling all developers! We invite you to provide your input on Feature Experimentation by completing this brief survey.
You should be able to do the following:
public override void SetDefaultValues(ContentType contentType)
{
base.SetDefaultValues(contentType);
if (SubMenuLayoutSelector == null)
{
SubMenuLayoutSelector = Resources.MegaSubMenuLayout_OneColumn_Value;
}
}
Hello,
We are using selection factory as shown below:
[Display(
GroupName = SystemTabNames.Settings,
Order = 300)]
[SelectOne(SelectionFactoryType = typeof(MegaSubMenuLayoutSelector))]
[Required]
public virtual string SubMenuLayoutSelector { get; set; }
and setting default value like this:
if (metadata != null)
{
metadata.InitialValue = Resources.MegaSubMenuLayout_OneColumn_Value;
}
But in CMS the field will be blank it's not taking default value set from method.
Is it right way to set the default value for selection factory? We tried this also in model class:
public override void SetDefaultValues(ContentType contentType) { base.SetDefaultValues(contentType); //Set values here }
this method is also not working to set default value.