<% var getColumnClasses = function(columnNumber) {
var classNames = 'col-12';
if (columnNumber >= 2) classNames += ' md:col-6';
if (columnNumber >= 3) classNames += ' lg:col-4';
if (columnNumber >= 4) classNames += ' xl:col-3';
return classNames;
} %>
<% if (articles.length) { %>
<% articles.forEach(function(article) { %>
<% }) %>
<% } %>
<% var getColumnClasses = function(columnNumber) {
var classNames = 'col-12';
if (columnNumber >= 2) classNames += ' md:col-6';
if (columnNumber >= 3) classNames += ' lg:col-4';
if (columnNumber >= 4) classNames += ' xl:col-3';
return classNames;
}
var maxArticles = 5;
// Sections and articles are already pre-filtered before being passed to this template
var childSections = sections || [];
var directArticles = articles || [];
var totalArticles = directArticles.length;
var hasMoreArticles = totalArticles > maxArticles;
var visibleArticles = hasMoreArticles ? directArticles.slice(0, maxArticles) : directArticles;
%>
<% if (subsectionStyle !== 'none' && childSections.length) { %>
<% childSections.forEach(function(section) { %>
-
<% }) %>
<% } %>
<% if (visibleArticles.length) { %>
<% visibleArticles.forEach(function(article) { %>
<% }) %>
<% if (hasMoreArticles) { %>
See all articles (<%= totalArticles %>)
<% } %>
<% } %>
<% if (!childSections.length && !visibleArticles.length) { %>
empty
<% } %>