<% var items = (data && data.items || []); var previewSuffix = ((renderType=='gridRowDataPreview') || (renderType=='gridItemPreview')) ? '_preview' : ''; var wrapper = (properties.wrapper || '%%%CONTENT%%%').toString().split('%%%CONTENT%%%'); var wrapperPrefix = (wrapper.length >= 1) ? wrapper[0] : ''; var wrapperSuffix = (wrapper.length >= 2) ? wrapper[1] : ''; %> <% if (items.length) { %> <%-wrapperPrefix%>
<% items.forEach(function(item, index) { %> <% //Item var itemStyle = ''; if(properties.minItemHeight) itemStyle += 'min-height:'+properties.minItemHeight+';'; //Title var showTitle = _.includes(['all','title'], item.contentLayout); //Body var showBody = _.includes(['all','body'], item.contentLayout); var contentContainerStyle = ''; var bodyStyle = ''; if(item.minContentWidth){ if(_.includes(['belowTitle','belowTitleLeft','belowTitleRight'], item.imagePosition)) bodyStyle += 'min-width:' + item.minContentWidth; else contentContainerStyle += 'min-width:' + item.minContentWidth; } //Image Container var imageContainerClass = ''; if((properties.titlePosition=='top') || (properties.bodyPosition=='top')) imageContainerClass += ' cmptListing_imageContainer-contentAbove'; if((properties.titlePosition=='bottom') || (properties.bodyPosition=='bottom')) imageContainerClass += ' cmptListing_imageContainer-contentBelow'; var imageContainerStyle = ''; if(properties.imageWidth) imageContainerStyle += 'width:'+properties.imageWidth+';'; if(properties.minImageWidth) imageContainerStyle += 'min-width:'+properties.minImageWidth+';'; if(properties.maxImageWidth) imageContainerStyle += 'max-width:'+properties.maxImageWidth+';'; //Link var linkOnClick = ''; var linkUrl = item.link||''; if(previewSuffix){ linkOnClick = 'return false;'; if(linkUrl) linkUrl = '#'; } else if(linkUrl.substr(0,3)=='js:'){ linkOnClick = linkUrl.substr(3) + '; return false;'; linkUrl = '#'; } %>
href="<%=linkUrl%>"<% } %> <% if(linkOnClick){ %>onclick="<%=linkOnClick%>"<% } %> class="cmptListing_link <% if(linkUrl){ %>cmptListing_link-linked<% } %>" <%if(item.linkTarget){%>target="<%=item.linkTarget%>"<%}%>> <% if(_.includes(['left','right','aboveTitle'], item.imagePosition)){ %>
<% if(item.image){ %><% } %>
<% } %>
<% if(showTitle){ %>

data-component-title-editor="title"<% } %>><%-item.title%>

<% } %> <% if(_.includes(['belowTitle','belowTitleLeft','belowTitleRight'], item.imagePosition)){ %>
<% if(item.image){ %><% } %>
<% } %> <% if(showBody){ %>
data-component-full-editor="body"<% } %>><%-item.body%>
<% } %>
<% if(_.includes(['belowBody'], item.imagePosition)){ %>
<% if(item.image){ %><% } %>
<% } %>
<% }) %>
<%-wrapperSuffix%> <% } else if(isInEditor) { %> <%-wrapperPrefix%>

Listing

view_headline
<%-wrapperSuffix%> <% } %>