Don't miss out Virtual Happy Hour today (April 26).
Try our conversational search powered by Generative AI!
AI OnAI Off
Don't miss out Virtual Happy Hour today (April 26).
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