Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.
Hi,
Maybe you could register your own ContentArea renderer
private static void ConfigureContainer(ConfigurationExpression container) { container.For<ContentAreaRenderer>().Use<AlloyContentAreaRenderer>(); } public class AlloyContentAreaRenderer : ContentAreaRenderer { protected override void RenderContentAreaItems(HtmlHelper htmlHelper, IEnumerable<ContentAreaItem> contentAreaItems) { var maxElements = htmlHelper.ViewContext.ViewData["maxElements"]; if (maxElements != null) { contentAreaItems = contentAreaItems.Take((int)maxElements); } base.RenderContentAreaItems(htmlHelper, contentAreaItems); } }
I didnt test this code.
Hi,
is there a way to limit the number (e.g. max 10) of content area items to render without using a valdiation.
Thanks