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
Would it be possible to make two versions of the Local Block one which has Culture Specific Properties and another which does not, both these would inherit the Same Base Class for business logic purposes.
Or create a custom validation attribute stops the user from saving the block when its edited in a language other than the master language.
I have a page with two properties that use the same local block ArticlePageFilterBlock:
[Display( Name = "Overview Definition", Description = "Defines overview parameters", GroupName = SystemTabNames.Content, Order = 1)] public virtual ArticlePageFilterBlock OverviewDefinition { get; set; } [Display( Name = "Render filter", Description = "Defines which elements are to be shown in the overview list.", GroupName = SystemTabNames.Content, Order = 2)] public virtual ArticlePageFilterBlock RenderFilter { get; set; }
[UsedImplicitly] [ContentType(DisplayName = "ArticlePageFilterBlock", GUID = "35AC1BED-64CA-44D4-878C-89B479F09F04", Description = "Enables configuration of filtering and sorting of the list of articles", AvailableInEditMode = false)] public class ArticlePageFilterBlock : BlockData, ITeaserItem, ISliderArticle { [Display( Name = "Categories A (OR)", Description = "Content categories which should be connected by OR", Order = 10)] [ArticleCategories] [CultureSpecific] public virtual IList<ContentReference> CategoriesOr { get; set; } [Display( Name = "Categories B (AND)", Description = "Content categories which should be connected by AND", Order = 20)] [ArticleCategories] [CultureSpecific] public virtual IList<ContentReference> CategoriesAnd { get; set; } [Display( Name = "Authors", Description = "Authors", Order = 30)] [AllowedTypes(typeof(PersonBlock))] [CultureSpecific] public virtual IList<ContentReference> Authors { get; set; } public Func<ArticlePage.ArticlePage, bool> GetFilter() { ArticlePageFilter articlePageFilter = new ArticlePageFilter(Authors, CategoriesOr); return articlePageFilter.GetFilter(); } }
So all these properties in the local block should be CultureSpecific only in the second property of the page that uses them.