Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
It's possible. You can create a custom editor to remove the label.
but if you only want to remove the label of the checkboxes, the simplest way in my opinion is creating a custom SelectMany attribute.
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public class SelectManyWithoutLabelAttribute : Attribute, IDisplayMetadataProvider
{
public void CreateDisplayMetadata(DisplayMetadataProviderContext context)
{
var extendedMetadata = context.DisplayMetadata.AdditionalValues[ExtendedMetadata.ExtendedMetadataDisplayKey] as ExtendedMetadata;
if (extendedMetadata == null)
{
return;
}
extendedMetadata.ClientEditingClass = "epi-cms/contentediting/editors/CheckBoxListEditor";
extendedMetadata.SelectionFactoryType = SelectionFactoryType;
extendedMetadata.DisplayName = "";
}
public virtual Type SelectionFactoryType { get; set; }
}
Hi, i have the requirement to show some checkboxes in an inline block without a label, but the cms is adding the property-name as fallback:
This is the main block:
public class ArticleFilterBlock : NonTrackingBlockBase { [Display( Name = "Articles filter criteria", Order = 10)] public virtual ArticleFilterCriteriaBlock? ArticleFilterCriteria { get; set; } [Display( Name = "Visible filters", Order = 20)] public virtual ArticleFilterSettingsBlock? ArticleFilterSettings { get; set; } }
and this is the ArticleFilterSettingsBlock
public class ArticleFilterSettingsBlock : NonTrackingBlockBase { [Display(Name = "Sort by", Description = "The initial sorting of displayed Articles in the result list", Order = 10)] [SelectOne(SelectionFactoryType = typeof(EnumSelectionFactory<ArticleSortOrder>))] [DefaultValue(ArticleSortOrder.StartPublishDesc)] public virtual string? SortBy { get; set; } [Display(Order = 20)] [SelectMany(SelectionFactoryType = typeof(EnumSelectionFactory<ArticleFilterBarSettings>))] public virtual string? ArticleFilterBarSettings { get; set; } }
So i want to show the ArticleFilterbarSettings without a label since it's just a bunch of checkboxes and the "Visible filters" is already the label for both properties.
It seems to be impossible :